Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Aren't the filenames . and .. also restricted in Unix?

Windows has many more restrictions. [1]

[1] https://kizu514.com/blog/forbidden-file-names-on-windows-10/



Note that "forbidden" filenames only apply to win32 paths. "Extended-length" paths can be used to create and open such files. This can cause issues with applications that don't know how to handle them.

But yes, Windows reserves (16 bit encoded) ASCII control characters and some special symbols like question mark and colon.

As for . and .. I believe that on UNIX they are just symlinks, though they may be treated specially by applications? On Windows they don't really exist but some APIs emulate them when resolving paths.


> As for . and .. I believe that on UNIX they are just symlinks, though they may be treated specially by applications?

No, they are treated specially by the kernel and/or the filesystem. They behave similar to hardlinks to the corresponding directory (hardlinks to directories aren't allowed nowadays, these two are an exception). The special treatment by applications is that many applications hide all files and directories starting with a dot, which happens to also apply to these two.


Ah, thanks for the correction.


Also peculiar, in Windows, is handling of files that have spaces at the end :) - I've seen in my gamedev career more than one case, where a tool doesn't do enough trimming on spaces only to bite us later.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: