clone 494112 -1
reassign 494112 autoconf 2.61-7
retitle 494112 autoconf: should close its output before calling 
File::Copy::move() on it
tag 494112 patch fixed-upstream
retitle -1 perl: document that File::Copy::move() doesn't flush open files
severity -1 wishlist
thanks

On Fri, Aug 08, 2008 at 11:01:49AM +0200, Vincent Lefevre wrote:
> On 2008-08-08 11:23:28 +0300, Niko Tyni wrote:
> > Frankly, I don't think File::Copy is doing anything wrong.
> > 
> > The documentation specifically says move() will copy the file if rename()
> > fails, and IMO it's clearly the responsibility of the caller to make
> > sure the file is closed or at least flushed.

> > The function doesn't even have any means to flush the file handle, it
> > just gets the file name.

> Well, this is not obvious. Even without using lsof, if Perl has
> a mapping between filenames and file handles in its own internal
> structures, this could be done.

While the Perl process knows if it has associated a filehandle with a
certain filename when opening it, it doesn't know if that file has since
been renamed or unlinked by someone else. That's up to the kernel.

> Perhaps it should be documented (e.g. in NOTES) that the caller must
> close the file or flush it when it is copied, in particular via move.

I suppose something like that wouldn't hurt. Cloning another bug and
reassigning the original one to autoconf. Ben: the patch mentioned
earlier in this thread is at

 http://lists.gnu.org/archive/html/autoconf/2008-04/binYsJgNJQSOq.bin

and can be found through

 http://lists.gnu.org/archive/html/autoconf/2008-04/msg00026.html
-- 
Niko Tyni   [EMAIL PROTECTED]



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to