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
release early, release often
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 -
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.
dirlist now has options -r to recurse subdirectories.
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.
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.
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.
Dirlist is a little program to create a directory listing. It is similar to "find", butwithout call to stat(). This way it is faster for modern FS like ZFS-FUSE.
Option -s added
Option -s adds a literal prefix (this is without a /) to the source path. It only does this on the fly when accessing the source file, so it has no effect on -p etc. options.
This new option is mainly for use with option -l, for example see "dirlist" http://permalink.de/tino/dirlist which only outputs names, not pathes. This way you can add the missing path again without complex "cd" constructs.
If the destination exists and option -b is not used, the output has been corrected to be more meaningful.
Bugfix release and script cmpanddel.sh added
There was a long standing bug in option -p due to a bug in my library. Previously only one level of missing upstream directories were created. However there was no other bad sideffect.
The new script cmpanddel.sh is nearly untested. It is an old script now changed to use mvatom. Those changes have not been tested much yet, the basic method is proven to work.
download (139475 bytes)
Newer version of tinolib to compile under Ubuntu 64 bit systems.
|[view more history]||[view complete history]|
License and Disclaimer
All you can see here is free software according to the GNU GPL.