This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [Patch] unlink
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Sat, 30 Oct 2004 13:39:42 -0400
- Subject: Re: [Patch] unlink
- References: <4182BDCF.3C04BAF8@phumblet.no-ip.org>
- Reply-to: cygwin-patches at cygwin dot com
On Fri, Oct 29, 2004 at 06:01:51PM -0400, Pierre A. Humblet wrote:
>Here is a patch that should allow unlink() to handle
>nul etc.. on local disks.
>
>It's a cut and paste of Corinna's open on NT and the
>existing CreateFile.
>
>It works on normal files. I haven't tested with the
>special names because I forgot how to create them !
>Feedback welcome.
>
>XXXXX This should NOT be applied in 1.5.12 XXXXXX
>
>Pierre
>
>2004-10-29 Pierre Humblet <pierre.humblet@ieee.org>
>
> * syscalls.cc (nt_delete): New function.
> (unlink): Call nt_delete instead of CreateFile and remove
> unreachable code.
Corinna suggested something similar to me a couple of months ago but I
wanted to wait for things to settle down somewhat after the original
use of NtCreateFile.
On reflection, however, wouldn't it be a little easier just to prepend
the path being deleted with a: \\.\ so that "rm nul" would eventually
translate to DeleteFile("\\.\c:\foo\null") (I'm not using true C
backslash quoting here)? I don't know if that would work on Windows 9x,
though.
cgf