MacOSX::File::Exchange - Perl access to the exchangedata system call
use MacOSX::File::Exchange; exchangedata("newfile", "oldfile");
or
use MacOSX::File::Exchange qw(:all); exchangedata("newfile", "oldfile", FSOPT_NOFOLLOW);
The Darwin/Mac OS X system call exchangedata atomically exchanges the contents and modification dates of two regular files, leaving all other metadata unchanged (this includes the inode numbers).
exchangedata
Expected arguments are two path strings and a flags integer. An omitted flags argument is interpreted as 0.
Available flags:
Do not follow leaf symlinks in paths.
FSOPT_NOFOLLOW
exchangedata(2) in your Darwin manual.
Bo Lindbergh, <blgl@stakcen.kth.se>
Copyright (C) 2013 by Bo Lindbergh
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.9 or, at your option, any later version of Perl 5 you may have available.
To install MacOSX::File::Exchange, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MacOSX::File::Exchange
CPAN shell
perl -MCPAN -e shell install MacOSX::File::Exchange
For more information on module installation, please visit the detailed CPAN module installation guide.