Perl Rename function unreliable?



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. 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.";

Is using this any less robust:

`/usr/bin/mv $oldfile $newfile`;

Thx,
CC

.



Relevant Pages

  • Re: Perl Rename function unreliable?
    ... > that renames some oracle archive logs and out of a run of say 100 logs ... > it will fail to rename a handfull. ... > I examine that file stats and they ... > I even added a sleepbetween each rename() call. ...
    (comp.lang.perl.misc)
  • Re: File underscore rename script
    ... sophisticated perl rename, to call with a simple 'rename' - and the ... regular expression renaming. ...
    (comp.unix.shell)
  • Re: File underscore rename script
    ... On my Debian-System there are at least two rename's. ... sophisticated perl rename, to call with a simple 'rename' - and the ... (sorry for my english) ...
    (comp.unix.shell)