in reply to Re^2: Moving Files
in thread Moving Files

If that's a concern, use File::Copy::move.

Replies are listed 'Best First'.
Re^4: Moving Files
by JavaFan (Canon) on Aug 07, 2008 at 17:22 UTC
    Hmmm, let's not, shall we? At least, not if you care about your permission bits.
    $ touch /tmp/foo $ chmod -w+x /tmp/foo $ ls -l /tmp/foo $ -r-x------ 1 javafan staff 0 Aug 7 18:16 /tmp/foo $ perl -MFile::Copy -wE 'move "/tmp/foo", "/var/tmp/foo"' $ ls -l /var/tmp/foo $ -rw------- 1 javafan staff 0 Aug 7 18:16 /var/tmp/foo
    But with mv:
    $ touch /tmp/foo $ chmod -w+x /tmp/foo $ ls -l /tmp/foo $ -r-x------ 1 javafan staff 0 Aug 7 18:18 /tmp/foo $ mv /tmp/foo /var/tmp/foo $ ls -l /var/tmp/foo $ -r-x------ 1 javafan staff 0 Aug 7 18:18 /var/tmp/foo