in reply to Re: Unix rename behaviour
in thread Unix rename behaviour

It's fairly simple to demonstrate that this is not true...

jasonk@critter% cat foo.pl #!/usr/bin/perl -w ################## open(OUT,">/tmp/testfileA"); print OUT "This is testfileA\n"; close(OUT); open(OUT,">/tmp/testfileB"); print OUT "This is testfileB\n"; close(OUT); open(IN,"/tmp/testfileA"); system("mv /tmp/testfileB /tmp/testfileA"); print <IN>; + jasonk@critter% ./foo.pl This is testfileA

We're not surrounded, we're in a target-rich environment!

Replies are listed 'Best First'.
Re^3: Unix rename behaviour
by welchavw (Pilgrim) on May 03, 2006 at 02:54 UTC
    Ok, I stand corrected. I have no access to a box to test with, so I was guessing.

    I suppose that the rename is just changing the directory entry. I believe that a /bin/cp will give the exact semantics that I supposed earlier? Maybe someone will check for me.

    Or maybe I'll just get downvoted.

    ,welchavw