- Thread Author
-
- #1
People at various times run into mysterious problems that have no apparent source but are eventually found out to be caused by the innocent use of a file named "aux.txt" or any one of the other reserved file names. It isn't realistic to expect that all users of such an ubiquitous system as Windows would learn about this technical limitation and remember what the reserved file names are. Is there any reason why the Windows file system does not check for this in order to either forbid these names, or at least issue a warning to the user when their presence is detected? The system knows what names are forbidden, users do not.
Solution
Windows Explorer checks for that, but that's only one particular app which is written to do so, it's not the underlying file system. Others, for example Microsoft Studio Code which happens to be in front of me right now, let me create source files with forbidden names. This program is not explicitly designed to handle the file system and it doesn't know to check for this. We can't expect all application software to do so. But if the name check was in the underlying file system itself instead of a higher layer of one program (maybe more, I don't know) then it would prevent the problem at large. Reality is, files are created, renamed, imported in various ways, and the system accepts them.
- Thread Author
-
- #3
Windows Explorer checks for that, but that's only one particular app which is written to do so, it's not the underlying file system. Others, for example Microsoft Studio Code which happens to be in front of me right now, let me create source files with forbidden names. This program is not explicitly designed to handle the file system and it doesn't know to check for this. We can't expect all application software to do so. But if the name check was in the underlying file system itself instead of a higher layer of one program (maybe more, I don't know) then it would prevent the problem at large. Reality is, files are created, renamed, imported in various ways, and the system accepts them.
- Joined
- Jul 4, 2015
- Messages
- 8,998
Tested explorer, cmd and VS code none of them let me create those files. They should all ultimately call into ntdll.dll and then into kernel mode I couldn't tell you where the check is but it's most likely in ntdll.dll or the kernel itself.
Tested from the SYSTEM account as well and still not able to make reserved files.
Tested from the SYSTEM account as well and still not able to make reserved files.
- Thread Author
-
- #5
VS Code prevents it for you? For me (version 1.28.0) it lets me name a source file aux.rs, which leads to compilation errors. If I try to name it aux?.rs however an error message is generated:
"The name aux?.rs is not valid as a file or folder name. Please chose a different name."
...and the file is renamed auxÉ.rs instead to avoid the problem. If I try to name it aux.rs then there is no warning and the name is accepted without change. Forbidden file names due to invalid characters are treated different than forbidden file names.
"The name aux?.rs is not valid as a file or folder name. Please chose a different name."
...and the file is renamed auxÉ.rs instead to avoid the problem. If I try to name it aux.rs then there is no warning and the name is accepted without change. Forbidden file names due to invalid characters are treated different than forbidden file names.
- Thread Author
-
- #11
Yes, it was the result of attempting to rename aux.rs to aux?.rs: the illegal question mark was replaced with a legal unicode character.
I am now trying to reproduce it but without success, the new name with its illegal character is simply rejected and the former name is restored. But I can rename it to other illegal file names such as con.rs, com2.rs and so on.
I am now trying to reproduce it but without success, the new name with its illegal character is simply rejected and the former name is restored. But I can rename it to other illegal file names such as con.rs, com2.rs and so on.
Similar threads
- Solved
- Replies
- 5
- Views
- 88
- Article
- Replies
- 0
- Views
- 7
- Replies
- 0
- Views
- 69
- Replies
- 0
- Views
- 441
- Replies
- 1
- Views
- 520