in reply to Re: Renaming a group of files occassionally deletes some
in thread Renaming a group of files occassionally deletes some

Sorry, the way it's worded is kind of strange. Is it saying that it will be clobbered if the file you're trying to rename to already exists in the directory?
  • Comment on Re^2: Renaming a group of files occassionally deletes some

Replies are listed 'Best First'.
Re^3: Renaming a group of files occassionally deletes some
by Util (Priest) on Jun 01, 2007 at 21:05 UTC
    On Win32 and Linux, this test program shows that clobbering will happen.
    use strict; use warnings; my $file1 = 'file1.dat'; my $file2 = 'file2.dat'; for my $file ( $file1, $file2 ) { open my $fh, '>', $file or die; print {$fh} "Test data for file '$file'\n"; close $fh or warn; } rename $file1, $file2 or die;
    Output: Produces only one file, named `file2.dat`, containing "Test data for file1.dat"