21 ms·
Seems like MS had the same idea according to an answer in the link: > Microsoft intentionally made programs install to C:\Program Files on Windows 95+ to forc
by alpaca128 5y ago
Seems like MS had the same idea according to an answer in the link:
> Microsoft intentionally made programs install to C:\Program Files on Windows 95+ to force programmers to deal with spaces in filenames.
- vesinisa 5y agoExcept for programs that were too old / obscure to fix I guess. I think at least the Symbian Development Kit was such that builds would fail with strange errors unless you installed it in any other path than the default immediate subdirectory of C:\, let alone under "Program Files".
- dr-detroit 5y agoPlenty of new stuff does this. As long as youre not .net or javascript nobody scrutinizes the trash work developers charge money for.
- lifthrasiir 5y agoAnd yet they introduced C:\ProgramData in later versions.
- kitkat_new 5y agowhy "yet"? one occurrence is enough to make devs care about it
- jjoonathan 5y agoImagine if they made programmers put 64 bit DLLs in a "System32" directory and 32 bit DLLs in a "SysWoW64" directory. That would really keep 'em on their toes!
- eyegor 5y agoYou should look into the behavior of the /windows/sysnative link. It appears and disappears depending on whether your process is running as 32 bit or 64 bit.
- Karuma 5y agoProgrammers should never put DLLs in those folders... Or even ever touch them.
- mastax 5y agoExcept for \Windows\System32\drivers\etc\hosts, of course.
- jaywalk 5y agoI occasionally try to search for the reasoning behind the location of the hosts file in Windows, and I always come up blank.
- blincoln 5y agoMaybe it's from back before Windows had a built-in TCP/IP stack? If it were a third-party/optional driver, having files related to it in a path under system32\drivers would make sense.
- mjevans 5y agoBack around Win 95 when they added networking it was based off of (IIRC) BSD's TCP stack and related tools. They were an optional 'third party' driver of sorts, but shipped by the first party. I'm not positive about WinNT or Win3.11 (for workgroups?)
- mixmastamyk 5y agoI remember adding "trumpet winsock" to Win 3.x back in the day. Says '94 for that, and summer of '93 for NT 3.1 debut: https://en.wikipedia.org/wiki/Trumpet_Winsock https://en.wikipedia.org/wiki/Trumpet_Winsock https://en.wikipedia.org/wiki/Windows_NT_3.1 https://en.wikipedia.org/wiki/Windows_NT_3.1
- HideousKojima 5y agoThey originally copied BSD's network stack, IIRC
- kevin_thibedeau 5y agoThey already hamstrung themselves with LONG because DWORD just wasn't good enough and now long can't be 64-bit either.
- ealexhudson 5y agoI wish they did "User Files" instead of "Users" too, because so much software breaks on the home area having a space in it. Not least, it makes writing scripts for various shells and getting the quoting rules right an absolute pain as well...
- the_mitsuhiko 5y agoThey used to. The folder was called `Documents and Settings` until Win7.
- 323 5y ago"Documents and Settings" still exists on Windows 10, as a soft link to "Users".
- 0des 5y agoYou know, this makes me wonder.. tangentially speaking- I wonder how hard it would be to rearrange the folder structure in linux so that I have something like this: /Users/{root, user0, user1, ... }... /System/{Logs, Apps/{opt, container, ...}, Temp, Conf ...}... /Devices/{Mount, sda, sdb, null ...}... /Boot/...
- selfhoster11 5y agoGoboLinux does exactly that: https://en.m.wikipedia.org/wiki/GoboLinux https://en.m.wikipedia.org/wiki/GoboLinux
- DarkWiiPlayer 5y agoDammit, I wanted to be the one to mention gobo linux [HN deleted my laughing emoji ffs]
- andai 5y agoBeat the system ʕ•ᴥ•ʔ
- 323 5y agoLaughs in C:\PROGRA~1\ (try it, still works in Windows 10)
- Someone 5y agoApart from what others mentioned, that can only work if the file system automatically creates 8.3 names. NTFS does not necessarily do that (https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-behavior https://docs.microsoft.com/en-us/windows-server/administrati...)
- the_mitsuhiko 5y agoThere is no guarantee that the short name has that. In fact on a lot of German Windows installations it was PROGRA~2.
- 323 5y agoWell, on my disk PROGRA~1 is "Program Files" and PROGRA~2 is "Program Files (x86)", so still works :)
- TowerTall 5y agoAnd on mine (Windows 11) "PROGRA~3" is "ProgramData"
- floatingatoll 5y agoThat order is not guaranteed consistent across installations, however.
- marginalia_nu 5y agoI wonder if code to this effect has ever been written before for (int i = 1; i < INT_MAX; i++) { if (dirExists("C:\\PROGRA~%d\\ProgramName", i)) {
- 5y ago
- deleted 5y ago[deleted]
- hetspookjee 5y agoI wonder how much global work could have been saved if Microsoft also provided a covered interface for all paths in the system. Not sure if there is any, but one good implementation might save thousands of poor implementations required to handle it.
- Too 5y agoYou have %Appdata% and friends.
- moontear 5y agoYou mean like the Environment.SpecialFolders enum? https://docs.microsoft.com/en-us/dotnet/api/system.environment.specialfolder?view=net-5.0 https://docs.microsoft.com/en-us/dotnet/api/system.environme... There are several other classes that take care of getting folders, least of which checking system variables.
- lamontcg 5y agoThen they made poor APIs so that you have to do this to get it correct: https://docs.microsoft.com/en-gb/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way https://docs.microsoft.com/en-gb/archive/blogs/twistylittlep... In nix at least you can call execve or other APIs that take a char argv[] and the whole problem is largely solved and you don't need to quote things.
- dan-robertson 5y agoOn the other hand their case sensitivity behaviour means that “cross-platform” Java applications can break if they are run on a non-windows platform where opening files is case sensitive (unlike on windows)
- 908B64B197 5y agoIt's actually a feature. Easier to add a flag to ignore case rather than fix bugs where files only differ by case and are therefore overwritten on a case-insensitive filesystem.
- henrikschroder 5y agoC:\PROGRA~1 Easy fix!
- billti 5y agoAnd then to really mess you up and ensure you handle parens properly, threw “(x86)” into the mix. (A real pain on some REPLs as well as dealing with environment variables).
- gattilorenz 5y agoFunny, in the Italian Win9x it is C:\Programmi, which I always thought was more convenient because of the lack of spaces :)
- cerved 5y agoSure. Microsoft only ever ships features
- antihero 5y agoShame it wasn't > C:\P̷̧̽r̸̬͘ŏ̵̮g̷̜͘r̸̦̋a̴͎̒m̶̲̈́ ̷̠̉F̵͇̈ĩ̴̫l̶̨͗ë̵̦s̸͚͆\
- Matthias247 5y agoIt not only keeps people on their toes due to the whitespace. The folder name is even localized. E.g. with german settings there is C:\Programme and c:\Programme (x86).
- spacechild1 5y agoYou can still use the English names, though.
- drdeca 5y agoI know that at least like, idk like 3-5 years ago, when I had gotten a new windows laptop (windows 7 or 8 I think), setting the main account to have the name "" (without the quotes), caused some problems with the basic functioning, including, I think, with some pre-installed programs, So, some things were still being handled not quite right (whether that's because it shouldn't be allowed to be the username, or because programs should handle it being in the path, I'm not sure, but probably one of those.)
- anarazel 5y agoI just wish they had a decent way to execute programs with arguments that might include spaces. But no, every program can do argument delineation differently.
- account42 5y agoAnd Microsoft even provides three different slightly incompatible ways to parse arguemnts: CommandLineToArgvW, the CRT and cmd.exe.
- deleted 5y ago[deleted]
- zerr 5y agoCould you please link the reference?
- 8bitsrule 5y agoAt one time there was no number 0. Half of binary was missing.
- zaphirplane 5y agoThere was a short path name IIRC like prog~1