Skip to content

Instantly share code, notes, and snippets.

@karwa
Last active May 4, 2022 07:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karwa/cbef7e798d6d92de95d837aac88ece40 to your computer and use it in GitHub Desktop.
Save karwa/cbef7e798d6d92de95d837aac88ece40 to your computer and use it in GitHub Desktop.
Windows paths are garbage
Using non-canonicalized paths (`\\?\C:\Users\User\Desktop\test\bar.` etc), you can create files which:
- Won't show up on the desktop (although they will show up in Windows Explorer).
- You can't open (tried in notepad via drag-and-drop and the 'open' panel).
- You can't delete.
Also, you can't delete their parent folder, either. Nice.
Additionally, some commands will resolve '.' components in paths, while others (like `mkdir`), but others (like `echo "hello" > \\?\C:\...` in CMD.exe) will reject those paths outright.
Hot. Garbage.
This is just shoddy engineering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment