Re: Is this script safe?



>>>>> "Mulander" == Mulander <netprobe@xxxxxxxxx> writes:

Mulander> Why can't you use perl's built in rename(); function ? I think it
Mulander> would be safer.

File::Copy::mv *does* use the built-in rename() if it can.
But rename() can't go across mounted filesystem boundaries, so "mv"
calls out to the O/S rename command (mv on unix, rename on windows)
to do the moving if the internal rename fails.

Or, this is what I remember, having had too little sleep.

In essence, File::Copy::cp emulates unix "cp" as best it can. Ditto "mv".

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxxxxxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
.



Relevant Pages

  • Re: Two Small Suggestions
    ... Global is probably my least favourable option as well - ... The reason it works as it does is because if you rename at any other scope ... Contrary to intuition it should actually be safer to rename at ...
    (comp.lang.smalltalk.dolphin)
  • Re: c:windowssystem32 tload32 infected byAdware-Virtumundo
    ... Rename or move to another folder is safer. ... Don't have original post, replying to reply. ...
    (microsoft.public.windowsxp.general)
  • Is this script safe?
    ... Why can't you use perl's built in rename(); ... would be safer. ... Prev by Date: ...
    (perl.beginners)