develooper Front page | perl.perl5.porters | Postings from October 2005

Re: Inconsistent behaviour when removing files on Cygwin

Thread Previous | Thread Next
From:
Yitzchak Scott-Thoennes
Date:
October 26, 2005 23:34
Subject:
Re: Inconsistent behaviour when removing files on Cygwin
Message ID:
20051027063434.GA3308@efn.org
On Wed, Oct 26, 2005 at 05:28:30PM +0200, S?bastien Aperghis-Tramoni wrote:
> Hello,
> 
> While correcting a bug in Net::Pcap Makefile.PL with a Windows developer,
> we stumbled upon the strange behaviour of the unlink() function under
> Cygwin. It looks like it tries to emulates the Unix behaviour but fails
> to achieve it.
 ...
> Ok, the equivalent program in C produces the same results, so the error is
> likely to be inside Cygwin API, but shouldn't this be documented somewhere?
> Maybe in perlport/"DOS and Derivatives"?

perlport says it short and sweet: (implied: For portable code:) "Don't
C<unlink> or C<rename> an open file."  I don't think repeating that in
a dosish section would be more helpful.

cygwin may defer unlinks until the file is closed or until the process
ends.  Exactly what it does depends on the exact flavor of windows and
how reliable (cygwin thinks) the relevant win32 api calls are there.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About