HOWTO: Delete undeletable files in NT

Parker, Ron rdparker@butlermfg.org
Fri Feb 13 11:15:00 GMT 1998


As others have said, MS-DOS, Windows 9X and the Win32 subsystem of NT 
treat CON.* as a reserved name for the console. It is mapped into the 
DosDevices namespace of the NT Object Manager. To delete files of this 
type, you must bypass the Win32 subsystem's file name checking 
routines. This may be done by referencing the file with \\.\<FULLPATH> 
or \\?\<FULLPATH>. Either the NT 'del' command or the gnu-win32 'rm' 
command will work provided you do this.

Examples:
*	del \\?\C:\dir\con.c
*	rm //?/C:/dir/con.c
*	rm \\\\?\\C:\\dir\\con.c

In my spare time I am working on patches to cygwin.dll that will use 
this convention to allow for using reserved file names. This will help 
with distributions that have con*, aux* and other such files in them.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00000.bin
Type: application/vnd.ms-tnef
Size: 2106 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/19980213/0b152aa6/attachment.tnef>


More information about the Cygwin mailing list