A while back, I was on DustPuppy and I did some testing with Dropbox. I was seeing what would happen if I had a file on Dropbox whose filename was a reserved name in the Win32 namespace (NUL, CON, PRN, AUX, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8). Since I couldn’t make one using Windows itself (try it for yourself, it won’t work), I made it on the Dropbox Web interface. It’s a valid filename, after all, it’s just reserved by Win32.
As expected, the file didn’t sync to Windows. I tried this also months ago with files that have illegal characters, and they also did not sync. I suggested that one could use the trick to automatically keep it from syncing on Windows.
With that all figured out, I forgot about it. A few days ago, I logged on to TODD and let Dropbox sync. The folder is mostly shared (TODD uses some separate symlinks) between the two operating systems in a common partition.
I log on to DustPuppy today and see that Dropbox is stuck indexing a file. That’s when I realized: when I synced on TODD, the file would have synced, too! Having a reserved name, it’s almost impossible to delete within Windows. I didn’t want to reboot into Linux, so how do I delete it from within Windows?
I remember having to do this before when I did the illegal filename trick. The first thing I tried was through the command line using del. Of course that didn’t work; it’s a Windows utility.
I then tried using the Win32 port of the GNU utility rm. That didn’t work either, probably because it’s a Win32 port.
Off to the Internet! I came across the Super User thread that helped me out the last time. As directed, I executed
It worked! Ha ha! I restarted Dropbox and it stopped trying to index the file. I also took a look at he Microsoft Knowledge Base article that was posted, and it gave a comprehensive list of things to try when a file can’t be deleted.
Unless you’re working with multiple operating systems, you probably won’t run into this problem. But if you do, now you know how to deal with it.
So, why are NUL and the others reserved names? They are aliases to devices, and are accessible from every directory. NUL specifically is analogous to *nix’s /dev/null ; it’s the “bit bucket“. It’s where you redirect a program’s output if you don’t care what happens to it.