Re: Perl Rename function unreliable?



"Rhugga" <chuck.carson@xxxxxxxxx> wrote:
> Has anyone experienced problems using perl rename() function? We have
> seen odd results using 3 different versions of perl. I have some code
> that renames some oracle archive logs and out of a run of say 100 logs
> it will fail to rename a handfull.

What message does it fail with?

> I examine that file stats and they
> are all identical in every possible way. (just different ctime/atime
> etc...) Perms are identical. The files are not open by another process
> (even though this doesnt matter per the documentation)
>
> I even added a sleep(5) between each rename() call.
>
> My OS types are a mix of Solaris 8 and 9.
>
> I'm using the rename command as follows:
>
> rename( $oldfile, $newfile) || die "Unable to rename $oldfile, manual
> intervention required.";

Include $! in the die string.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.



Relevant Pages

  • Perl Rename function unreliable?
    ... Has anyone experienced problems using perl rename() function? ... that renames some oracle archive logs and out of a run of say 100 logs ... I examine that file stats and they ...
    (comp.lang.perl.misc)
  • Re: Another fine mess
    ... jobs can fail every minute. ... [[If rename fails, and there is no C, subsequent jobs fail. ... The information contained in this communication (including any ...
    (bit.listserv.ibm-main)
  • Re: Name function in Access 2002 (XP)
    ... There are *myriads* of reasons that a rename can fail, ... the new file name is invalid; ... The VBA errors are very specific when there is a problem. ...
    (microsoft.public.access.formscoding)
  • Re: shell scrpt to rename
    ... How do I rename *.foo to *.bar? ... command line buffer), and will fail if any file names contain a ... In some linux distributions you may be able to use the rename ...
    (comp.unix.shell)
  • Re: Copy files with rename messagebox
    ... > I would like to know if it is possible to use an vbscript to move a ... But if the "variable amount" is a large number, ... You could rename it ... that would fail if a file named A.txt already existed in C:\B\. ...
    (microsoft.public.scripting.vbscript)