From: Keith M. <kei...@to...> - 2005-01-06 15:30:25
|
> But what really confuses me is--what's special about 'nul.c'? > > C:/usr/bin[0]$ls -o nul* > zsh: no matches found: nul* > C:/usr/bin[1]$/MinGW/bin/cpp -E -dM nul.c | grep GNU > C:/usr/bin[1]$/MinGW/bin/cpp -E -dM null.c | grep GNU > cpp.EXE: null.c: No such file or directory > cpp.EXE: no input files > C:/usr/bin[1]$ > > Is that the old DOS 'NUL' device? Or is it something > tricky built into gcc? Your guess about the old MS-DOS NUL device is correct -- it's just the same in Windoze! You can't name a file nul.anything, because the OS will ignore the extension, and map it to the NUL device (/dev/null in *NIX parlance) anyway. So, nul.c will always appear to exist as an empty file, but will never show up in any directory listing. Also, if you try to save real content as nul.anything, it will simply disappear! This trick only works on MS-DOS/MS-Windows -- on a real *NIX, /dev/null.anything is a distinct filesystem entity, which you probably can't even create, unless you run as root (bad idea, usually). NUL is a special name on MS-DOS/MS-Windows, and neither MSYS nor Cygwin can circumvent that, but there's nothing special about it on *NIX. Cheers, Keith. |