in reply to Re^2: Unix rename behaviour
in thread Unix rename behaviour
-> Code should look like this
$ cat foo.pl #!/usr/bin/perl -w ################## open(OUT,">testfileA"); print OUT "This is testfileA\n"; close(OUT); open(OUT,">testfileB"); print OUT "This is testfileB\n"; close(OUT); open(IN,"/tmp/testfileA"); rename ("testfileB", "testfileA"); print <IN>; close IN;
So the answer is "neither - rename closes the filehandle". I.$ ./foo.pl readline() on closed filehandle IN at ./foo.pl line 15.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Unix rename behaviour
by BrowserUk (Patriarch) on May 03, 2006 at 10:04 UTC |