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

Re: Inconsistent behaviour when removing files on Cygwin

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
October 26, 2005 08:38
Subject:
Re: Inconsistent behaviour when removing files on Cygwin
Message ID:
20051026173900.326d5d62@grubert.mandrakesoft.com
S├ębastien Aperghis-Tramoni wrote:
> When executed under a random Unix/Unix-like (here on Linux), it outputs:
> 
>     'test.txt' doesn't exist on the filesystem
>     in dir:
>     'test.txt' doesn't exist on the filesystem
>     in dir:
> 
> which is what I expect. Now when executed on Cygwin, here is the output:
> 
>     'test.txt' doesn't exist on the filesystem
>     in dir: test.txt
>     'test.txt' doesn't exist on the filesystem
>     in dir:
> 
> which is wrong because if unlink() doesn't return an error, the file is
> supposed to be deleted. -f indeed says that the file is not present, but
> readdir() still lists it. Who should I believe?

What says -e ?

> I can't test but based on previous experiments, ActivePerl is more
> consistent as unlink() fails and the file is not removed.

Cygwin and Win32 are whole different platforms. :)

> Ok, the equivalent program in C produces the same results, so the error is
> likely to be inside Cygwin API,

I just was going to say something like this !

> but shouldn't this be documented somewhere?
> Maybe in perlport/"DOS and Derivatives"?

Patches welcome, from someone who knows Cygwin internals better.

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