The software on this pages will slowly be moved to GitHub https://github.com/hilbix/. The CVS repository will be migrated to GIT as well, so the history will be preserved, a bit. See FAQ.
The tools are developed under Linux with
ESR's paradigm
release early, release often
in mind.
So you can consider this beta software, or alpha, or pre-alpha, or even worse ;)
Have a look in the download directory for all downloads.
As always here, all you get is the source. No binaries here.
Move files by atomic rename instead of copy.
⇒ ⇒ ⇒ The development shifted to another location. All future versions will be published at https://github.com/hilbix/mvatom ⇐ ⇐ ⇐
Post-modern mv implementations re-invented a wheel which is no more round. If they cannot move they do a copy/unlink() operation which is unsatisfying, as when the unlink() fails you stay with the copy which was insanely done.
mv shall be an atomic operation. However you cannot switch mv into atomic mode. This version here does what mv is supposed to do:
It renames the target and fails if it cannot do the rename (but beware the common NFS bug in such a situation). In unsafe mode it does this using the rename() operation (note that rename() has a possible race condition which may overwrite a destination unconditionally, if it is created after mvatom has checked the presence of the destination), in safe mode (will be introduced in 0.5.0) it will use hardlink/unlink. The move is "atomically" in respect to the destination either is there completely or missing, it is not "atomically" in the sense of "man 2 rename". If you need this, you need option -uf.
Another thing is that it only guesses something for the last argument like mv does if it is instructed to do so. So it always works reliably. You know what it does from looking at the command line, and if no heuristics are given this does not depend from the last arg beeing a directory or not.
If the destination is a directory this must be given as an option to mvatom. Also all options are simple and clear and there is no way to overwrite files, as mvatom never overwrites files (but beware the race condition in unsafe mode which was used before 0.5.0).
Also you can "move away" files with mvatom, too. This is done with the "backup" feature, where an existing destination can be renamed.
There now is a helper script:
The helper "dirlist" now is in a separate package. Example use:
dirlist -0p DIRa | mvatom -0dDIRb -
version 0.4.4-20110825-142933 | Nothing changed in mvatom, but dirlist now is a separate package. This can be considered a bugfix, though, as previously 'dirlist -rp .' did not work correctly. If you wonder where version 0.5.0 is: It is not there for the moment. So mvatom still operates in unsafe mode! Please keep that in mind. |
version 0.4.3-20090409-200703 | dirlist now has options -r to recurse subdirectories. |
version 0.4.2-20081016-214847 | dirlist now has options -a -d -l -m -u -o, and accepts more than one directory With options -a -l -m -u you can set which types of files are output with dirlist. However this needs an additional stat() call per file. With option -d you can debug this new feature. With option -o you can terminate dirlist after the first successful argument. The idea is, if you have a list of possibilities, the first one wins. |
version 0.4.1-20080528-164909 | Option -c added WARNING: This version still operates in unsafe mode! The description is already updated to upcomming version 0.5.0, which fixes a possible race condition (however I am still working on this fix). With option -c you can define a directory where the backups are created instead of the target directory. It must be on the same filesystem as source and destination. |
version 0.4.0-20080521-200002 | Option -a added, "move away feature" fixed and renamed to option -ab, dirlist now has some options Option -a has less race conditions than option -b. However the latest moved file then does not keep it's original name if an elder file with same name exists. The "move away feature" had a bug in conjunction with option -s. This bug has been fixed. The "move away feature" now needs both options -a and -b present to work. If these options are else used together, this is an error. Dirlist now knows about a couple of options.
|
[view more history] | [view complete history] |
License and Disclaimer
All you can see here is free software according to the GNU GPL. |