Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-09-2013, 05:58 PM   #1
Giuseppe Chillem
Groupie
Giuseppe Chillem doesn't litterGiuseppe Chillem doesn't litter
 
Giuseppe Chillem's Avatar
 
Posts: 178
Karma: 134
Join Date: May 2010
Device: IREX DR1000
Moving instead of copying ?

Hi,
as most libraries are on the same partition, could calibre be programmed to move the files instead of copying and then deleting them ?

Last edited by Giuseppe Chillem; 04-09-2013 at 06:04 PM.
Giuseppe Chillem is offline   Reply With Quote
Old 04-09-2013, 11:48 PM   #2
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
Yes it COULD. But I don't think it should. It is safer to first copy all the files, then if successful, delete the original files. Then all or none are moved. I suspect this is intentional.

I prefer safety before speed, when it comes to how calibre manipulates files.

If you need speed, invest in faster disks and more memory for disk caches.
Adoby is offline   Reply With Quote
Advert
Old 04-11-2013, 11:23 PM   #3
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,457
Karma: 26645808
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Adoby View Post
Yes it COULD. But I don't think it should. It is safer to first copy all the files, then if successful, delete the original files. Then all or none are moved. I suspect this is intentional.

I prefer safety before speed, when it comes to how calibre manipulates files.

If you need speed, invest in faster disks and more memory for disk caches.
Adoby,

A move within a POSIX compliant partition is a heck of a lot safer than a copy, because it involves a lot less I/O.

A move is a copy and delete of an inode within the directory structure rather than copying and deleting whole files. Many file systems (NTFS, HFS+ etc) give the directory structure extra safeguards to reduce the chance of corruption - such as pre-allocating disk space, using contiguous clusters etc.

And, on a POSIX compliant file system Calibre in fact does do moves (copy and delete inodes) when a book or author is renamed within a Library (directory). So why not do the same when a book is moved between two Libraries (directories) in the same partition.

IMO GC has made a valid suggestion - that is in fact safer.

BR
BetterRed is online now   Reply With Quote
Old 04-11-2013, 11:37 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No a move is not safer, the filesystem and the metadata.db database have to be kept in sync. That cannot be guaranteed with a move.

And calibre does not do a copy, it does a hardlink, then updates metadata.db and then a delete. That way the worst that can happen is you have extra files in your library, but metadata.db and the files can never be out of sync.

The only situation where calibre does a copy if is hardlinking fails because whatever filesystem you have your calibre library on is poorly implemented.
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying library phantom_cyclist Library Management 2 11-02-2012 06:13 AM
Error when copying. Motomaggot Calibre 6 07-09-2012 11:34 PM
copying from bookshelf to PC lvd4 Fictionwise eBookwise 33 10-18-2010 06:51 PM
Feature Request: Moving and not copying when adding files... Chuwiey Calibre 7 07-03-2010 05:35 AM
Copying contents of SD el.astrologo Sony Reader Dev Corner 2 05-30-2009 09:56 AM


All times are GMT -4. The time now is 04:50 PM.


MobileRead.com is a privately owned, operated and funded community.