4 ms·
Microsoft's Windows 95 put spaces into "c:\My Documents" and "c:\Program Files" so that developers targeting Windows were forced to support spaces in filenames.
by michaelt 2y ago
Microsoft's Windows 95 put spaces into "c:\My Documents" and "c:\Program Files" so that developers targeting Windows were forced to support spaces in filenames.
Of course, in those days if an OS upgrade broke some third party software, the end user paid for an upgrade. So although Microsoft forced developers' hands, the developers all got paid for their trouble. And you'd only have your hand forced that way once or twice a decade.
Windows at the time was also all about the GUI file-pickers. Breaking the command line? Shell scripts? What are those?
- toast0 2y agoAnd now it's \Users, presumably because after 20 years, Microsoft gave up?
- hwc 2y agoOr someone got tired of typing long paths.
- Uvix 2y agoThey changed from \Documents and Settings to \Users in Vista, alongside other profile rejiggering (e.g. introducing AppData folders). By that point software had either been fixed or would never be fixed, so keeping a space in the name wasn't particularly useful.
- rcxdude 2y agoIt's still very common for usernames to have spaces, though.
- alterom 2y agoAnd now it's \Users, presumably because after 20 years, Microsoft gave up? Only if you assume that people rarely have spaces in their Windows login names (e.g. "Joe Smith"). Either that, or Windows users have learned to not be scared of spaces in filenames, usernames, and their own literal names.
- numpad0 2y agoWindows set up with Microsoft Account uses abbreviated e-mail for user names, because UTF-8 breaks apps, including many East Asian apps. non-Western Windows users always knew never to use anything outside ASCII for usernames, passwords, or any programmatically used identifiers. It's English users that haven't learned it.
- alterom 2y agoSure, but space is an ASCII character.
- throw16180339 2y agoIIRC, they changed it to get more value out of the 260 character MAX_PATH. I know there was some sort of manifest to enable longer paths, but I'm not sure what the current status is.
- LegionMammal978 2y agoThe status quo is that officially, you still have to both set a registry key (or equivalently, set an option in the Group Policy Editor) and add an element to each application manifest. The official workaround at runtime is to use the "\\?\" prefix with an absolute path to create an unrestricted verbatim pathname. For instance, the fs::canonicalize() function in Rust will always return such a pathname, to many programmers' dismay, since outside tools often choke on them. The unofficial workaround is to set the undocumented IsLongPathAwareProcess bit in the process's PEB. The Go runtime does this, but silently falls back to "\\?\" prefixes if the Windows version is too old. (Note that in general, canonicalizing paths is safer on Windows than on Unix-like systems, since open directories cannot be renamed.)
- 3eb7988a1663 2y agoOneDrive breaks that convention. Last two companies I was at, the corporate location was something like "$HOME/OneDrive - $COMPANY". That the two companies had the same format tells me it is a default and/or suggested practice for some reason.
- bigstrat2003 2y agoThat doesn't sound right. Microsoft is obsessed with backwards compatibility, going so far as to accommodate programs that were writing to Windows' private memory just to preserve it. Deliberately breaking programs isn't in their ethos at all.
- sltkr 2y agoThe new filesystem APIs were introduced with Windows 95, so there was no backward compatibility to break. New programs using those new APIs were forced to support spaces in directories. Using spaces in the system directories forced application developers to consider that scenario and deal with it appropriately. Meanwhile, DOS and Windows 3.1 applications that did run on Windows 95 could access files under a backward compatible 8.3 scheme, like C:\Progra~1\ instead of "C:\Program Files".
- bigstrat2003 2y agoThat's a good point, thanks for pointing it out.
- michaelt 2y agoI'm thinking of the transitions from Windows 3.1 to Windows 95 (IIRC introducing 32-bit and filenames longer than 8 characters) and the transition from Windows 95 to Windows XP (IIRC introducing a proper permission system, thus breaking anything that relied on being able to write things outside of user-owned folders) I agree they were famously accommodating in those days. But they also had enough market power that if they said users could only write to one folder and it had a space in the filename, developers who disliked it couldn't vote with their feet.
- lousken 2y agoAnd yet... if you create user using a display name e.g. Peter Čenička in AAD and deploy a PC with intune you will get home folder called PeterČenička.[0] It breaks SO MANY things. And no, that beta UTF8 system wide setting does not work with 3rd party apps. I just dont understand why they dont use part of the email address as the home folder name. And just because of this stupidity, user display names have to be without any of these characters Microsoft ... PLEASE [0] https://doitpshway.com/do-not-use-diacritics-in-aad-user-displayname https://doitpshway.com/do-not-use-diacritics-in-aad-user-dis...
- dizhn 2y agoA lot of software still had issues and asked the user to use C:\Directory directly. Some probably still do.
- reginald78 2y agoI remember trying to install Visual Studio in the mid-late 2000s (when SSDs make hard drive space small again) to a directory other than C: and found that after following a rather convoluted process you could only actually move maybe 20% of the install files off C:.
- StefanBatory 2y agoIt is still the same. :(
- yonatan8070 2y agoI've seen some things installing directly into C:\, NVIDIA's software jumps to mind
- akira2501 2y agoC:\Progra~1 They didn't force anything.
- moritzwarhier 2y agoDid they intentionally use only folder names with spaces that are at least 9 characters long and with the space after the first 6, so that the 8.3 version contains no spaces? Pretty clever if so :D
- volemo 2y agoWhat ‘bout “C:\My Documents” though?
- cobbaut 2y agoThat came later, end of 1996 with OSR2.
- repiret 2y agoA space in an otherwise 8.3 file name would still be treated as a long file name and get a ~1 shot name alias.
- moritzwarhier 2y agoThanks for the clarification! I was curious about a deep dive into this topic, and skimmed the MS doc pages after a Google search. They mentioned different Windows APIs and Long file names, but the only mention of the tilde compat layer I found was very superficial ("some file-systems" use the tilde as special character), so I abandoned my initial interest in getting up to speed on this during a 2min weeekend read.