logoalt Hacker News

lelanthranyesterday at 10:23 AM3 repliesview on HN

>One day a small file turned up in everyone's network home directory called null. A *nix person had evidently had a go at writing a .bat file

I assume that they first tried /dev/null which failed, so then moved onto just plain null?

Otherwise it would not make sense that a unix programmer did this. More likely ula dos programmer misspelled NUL as null.


Replies

rep_lodsbyesterday at 11:35 AM

Fun fact: "/dev/nul" (with only one L) would have worked, even if there is no directory with that name.

That's been a feature since DOS 2.0, there was even an undocumented option AVAILDEV to make the prefix mandatory, instead of having device names present everywhere. But it broke the common trick used to detect if a directory exists ("if exist c:\some\path\nul").

3formyesterday at 10:57 AM

Unix programmer remembered that in there's no /dev/null in DOS and that it's something shorter, and tried null which worked. Didn't check the directory contents afterwards. So basically your first sentence - doesn't seem at all unlikely to me. (I mean, I think it happened to me at least once too)

jtoledoyesterday at 10:37 AM

I've already created a 'NULL' file, but it was not a Unix thing... It was just because I got confused if it was NULL as in the programming languages I usually use.