Mutex wrote:In Windows, you need to do this through a terminal emulator (Git Bash worked for me), Windows Explorer won't allow you to create them, and actually throws an error if you try deleting them! So, fun prank potential there obviously. The Linux file manager I tried allowed both creation and deletion.
I don't have any 'terminal emulator' other than the
terminal emulator, arguably, that is cmd.exe. I can md " spaces"
and echo Hello > " spaces.txt"
or notepad " loadsofspaces.txt"
(ironically, which doesn't survive HTML rendering for the number of consecutive spaces it actually has) which can be then be saved, but see later.
I can do this all I like and get absolutely no problem, nor any problem with deleting or renaming them in any file explorer (including load/save dialogues), except that they shave off and throw away any leading whitespace when renaming (or using the "Save as", from notepad/etc, but just Ctrl-S saving as the provided name after starting up with "Cannot find the. loadsofspaces.txt file. Do you want to create a new file?" retains the given whitespace-leader). I haven't yet managed to provoke an error being thrown, just silent "You obviously didn't mean
all those spaces" when I let the non-DOS tools mess with them. (c.f. ren " 1leadingspace.txt" " 2leadingspaces.txt"
working as imagined, but F2 on the file sanitising the spaces away.)
DIR /X shows that the SFN is SPACES~1.TXT (or similar) alongside the space-prefixed LFN. Could it be your Git Bash that isn't accessing one or other of the LFN/SFN portiins of the FAT table properly, thus tripping up explorer.exe and its derivatives when dealing with more unstandardised stuff?