Humor: Interview with an Ex-Microsoftie Who Used to Name OS Folders
secretgeek.net
secretgeek.net
"Program Files" and "Documents and Settings" have spaces to force software to support spaces in paths.
system32 for the Win32 version of system makes perfect sense. 64-bit Windows continues to use the Win32 API, and renaming system32 would have broken compatibility with dumb programs that hardcoded the name. SysWOW64 is the system32 directory for Windows 32-bit on Windows 64-bit. WOW64 is perhaps an overly cutesy name, but it's actually fairly descriptive.
And yet the platform where it's hardest to support spaces in paths is... windows!
On UNIX the process-creation API (execve) explicitly takes an array of arguments. There really aren't any special characters as far as the API is concerned (except \0): what you pass to execve will be the same as what the new process sees in main()
In windows, CreateProcessW() just is given a command line with space-separated argument names. Then the CRT in the new process will split that back up before main() is called. To be sure to get the arguments you want in main() you need to carefully quote the parameter you pass to CreateProcess using the exact rules that the CRT will use to unquote them -- in my experience this wasn't well documented, either.
Worse, since that splitting is the responsibility of the new process, programs can skip the CRT and do it themselves. If they don't follow exactly the same rules the CRT does things break if you try to send an argument with an escaped metacharacter.
HN should too, :p. Put it in http://eeemo.net/ to see what I mean.
Yes - OP just posted them. :) (for the record: your explanations, while they may be true, are not much better than the OP's)
Anyway, Unix naming scheme is also pretty unintuitive so I guess it's a hard problem.
"compatible with dumb" makes short-term business sense, but I'm not sure I'd call it /perfectly/ sensible...
You basically get ranked on how visible your stuff is to management, so you:
1) name your project as patriotically as possible. It's gotta include one of "Windows", "Microsoft", "XML", "COM", ".NET", "Modern" -- preferably all of them multiple times, especially if it has nothing to do with any of them.
2) make sure to stick the name in as many places as possible. A great place is the default filesystem structure, where everyone is bound to come across it.
3) earn bonus points if you can massage it into a de-facto standard (hello, XHR)
With any luck, Microsoft Modern framework for Windows Azure .NET connectivity with Windows Azure 8.1 will show up on your reviewer's radar and you can enjoy your juicy bonus until the same time next year.
Source: used to work there
P.S. I'm not a Microsoft cynic -- just having a bit of fun :).
("Ballmer's Law" has a nice ring to it..)
/etc isnt called /conf or configuration because it contains examples, scripts and other small stuff as well, which is etcetera.
/var is for variable data like logs and pid files, not meant to be changed by the user directly
/opt sucks and is for losers who dont know about /usr/local or how to install stuff in ~
The Linux way makes much more sense than Windows or MacOSX way. binaries are in bin libraries are in lib, whats not to like?
It did mean "user" originally. Home directories were usually put there.
However, the root filesystem was typically very small. So very early on in UNIXs evolution things that were large and not needed during system boot ended up finding homes in /usr, simply because it was where the bulk of the disk space was. So you got /usr/bin, /usr/dict, ...
Eventually /usr got so full of non-user content, UNIX-based OSes started putting home directories somewhere else entirely (i.e. /home on linux for example) Because the user to home directory mapping was just held in /etc/passwd, it was much easier to move the users than everything else. Later, the "Unix System Resources" backronym was coined.
So mintplant is right: /usr is very much a historic wart on the UNIX filesystem layout.
I disagree. /opt is for systemwide installations of monolithic software by dumb companies that can't fit their software into the standard layout. In the Linux FHS /usr/local/ is supposed to be for non distribution installed software that nonetheless uses the standard layout with /usr/local/{lib,bin,doc} etc. In /opt you usually have something like /opt/somesoftware/ and some non-standard hierarchy underneath.
You are actually fully agreeing with what was said !
Um, good luck with your packages where you relied on the OS. Let's not talk about stdlibc++.
Hint: if you really want your stuff to work for a long time, depend on the kernel and nothing else.
/opt is really where: /opt/importantstuff goes. The stuff where they bundled the libc because Debian changes too fast. Freaky stuff. Telco stuff...
One would certainly never dream of keeping entire web sites in there!
Now when you have web applications they can be in /srv as well and the database is usually wrongly put in /var (looking at you mysql) but what you gonna do when you need a system user, just like a users stuff is supposed to be in home so put your database there /home/postgresql/its_datas here, as anyway you need to run the db as its own user.
Makes sense no?
Doesn't it stand for 'Extended ToolChest' ?
It could be called misc as well in my opinion.
They both use UNIX architecture...
http://lists.busybox.net/pipermail/busybox/2010-December/074...
I've seen plenty of "Accounts for Proctors' Attention.xlsx" style files. Case insensitivity would lose the case there. :/
Not least this can sometimes result in some odd corner cases.
shrug
What corner cases does it lead to?
Personally, I'd aggressively pursue case-insensitivity and treat the problem of "oops the user can't create two files that have nearly the same name" as a much smaller bug than "oops the user can create two files have semantically the exact same name".
I guess there are still some fears to try it again, considering that current file systems in mainstream OS' are "good enough".
To me, it's even more funny when you realize "WOW" actually means "Windows on Windows." Say what??
It's NT's syscall translation layer, CPU mode switching backend and entry point front end. It was originally used to run 16-bit apps on 32-bit platforms but is now WOW64 so is to run 32-bit apps on 64-bit machines.
Basically it's a very light weight virtualisation layer.
And it works well. My circa 1996 RPN calculator I wrote in VC++ works perfectly on 2013 x64 machine.
Still, when I first heard the phrase "Windows on Windows" I had a chuckle.
It reminds me that I enjoyed the way x86 apps ran on my old Alpha NT machine. If I recall correctly, the process list included "fx32" beside each.
The Windows 2000 loading screen had the tagline "Built on Windows NT Technology." They left it there through multiple SP rollouts IIRC.
For everyone worried about Win98 relation simple "Built on Windows NT" would work.
What are you trying to do? Make me feel bad for having a good laugh at the name when I first looked it up? :)
Recently Microsoft went full Keanu with Windows on ARM or WOA -- but eventually they changed that to Windows RT (which might be actually worse).
One could argue that someone who knew Unix 30 years ago could still use command line in today's Linux without much problems.
$ mkdir ".. "
$ ls -a
. .. ..
Fun eh? $ touch ./~
# Much later I noticed the "~" file in the directory
# so I mindlessly decided to cleanup:
$ rm -rf ~
Luckily $HOME was on a _really_ slow NFS mount so I didn't manage to remove anything too important before I killed it.A friend of mine did a "rm -rf ~ /tmp" rather than "rm -rf ~/tmp" on a fast SCSI local disk on his Sun workstation.
His backup strategy of tarring up everything into ~/backup went with that one too. I lectured his ass on that one.
However...
The same guy, no less than 8 years later carried around a DVD-RAM with his single copy of his life's work on it (I assume this was only 8 years of his life) and jammed it in one of those dodgy Pioneer slot loader drives and proceeded to mount it.
bzzzt ... wheee ... clunk ... BANG! DVD span to full speed and promptly shattered taking the drive fascia off and spraying everyone with bits of "I told you so".
He now puts up scaffolding which worries me even more...
You know like recording numbers as string in the format: "0000000000000000000000000123.23210000000000000"
Explain the validity of:
mkdir " "
mkdir " "
mkdir " "
?It at least violates the principle of least surprise
And I don't see how it violated such principle. You tell it to create a file with spaces - you even emphasized them with quotes -, and you're surprise it did so?
mkdir ..<space>
it tells you "cannot create directory". You have to explicitly tell it you want a space in by using quotes (as you well know).Oh, and it's my computer. I don't want my shell telling me what I'm "allowed" to do. If I explicitly tell it to do something, it should damn well do it!
VARX=".. " # by accident as the result of a command
mkdir $VARXHere ' ' is part of both worlds: . .. ..
A first idea: . .. ..\
ls may also take inspiration from bash completion, where dirsep serves as a better delimiter than ' '
noob ~ $ mkdir -pv lsb/wat
noob ~ $ cd lsb/wat
noob ~/lsb/wat $ mkdir ".. "
noob ~/lsb/wat $ ls -lah
total 12K
drwxr-xr-x 3 noob noob 4,0K august 28 16:52 .
drwxr-xr-x 3 noob noob 4,0K august 28 16:52 ..
drwxr-xr-x 2 noob noob 4,0K august 28 16:52 ..
noob ~/lsb/wat $ cd ..<TAB-COMPLETION>
../ .. /https://isc.sans.edu/diary/Help+eliminate+unquoted+path+vuln...
http://xato.net/hardening/the-programexe-problem/
"The problem is that it doesn't know. It just starts
at the beginning and tries finding an executable until
it finds a match. So in this case, it will try these
files every time you run the command:
C:\Program.exe
C:\Program Files\Internet.exe
C:\Program Files\Internet Explorer\iexplore.exe
"You might see where I'm going with this: if you
place an executable named program.exe in the root
directory, it will probably end up running quite
a bit. In fact, it will run anytime Windows
launches a Program Files executable that does not
have quotes around the path." [1]
[1] http://www.securityfocus.com/columnists/301> Batch files ran programs from C:\Windows\System32 with the expectation that the resulting program would match the native OS. These expectations were not explicit, but they were implied by the nature of the activity. If the System32 directory were filled with 32-bit programs, then a batch file that ran the C:\Windows\System32\REG.EXE program to upset a system registry setting would be running the 32-bit version of REG.EXE, which means that it would be updating the 32-bit simulated version of the registry instead of the real 64-bit version. Other types of scripting files (such as REG files) have the same problem.
http://technet.microsoft.com/en-us/magazine/ff955767.aspx
How did Linux handle this problem?
Why do I need something like that? (I expect some binary compatibility, but we're just opening a can of worms...)
By comparison, most of the configuration files / registry equivalent info in linux are saved in plain text, and AFAIK all of them did not care about the 32/64 bit version of the executables.
in /usr/bin of course
- But it's kinda personal stuff...
so put it in /usr/local/bin
- Oh right, but now I have more stuff that's not really important but still useful
that's what we have /opt for
- but... what if it's optional and only on my machine
oh hell, just create /opt/local/bin and be done with it already!
You can't blame *nix for having too much choice. Especially when it's coherent.
C:/Program Files (x86)/VendorName/FooProg
C:/Users/Me/AppData/Local/FooProg
C:/Users/Me/My Documents/FooProg/
C:/VendorName/FooProg (I'm looking at you, AMD)
The registry (which is sorta like /etc, and often abused to store stuff like recent searches, etc)
Linux is definitely worse on that front I agree, but let's not pretend Windows is super-consistent about file locations. I only say this after much frustration recently trying to find things.And when you finally figure it out, Fedora moves everything to /usr.
Though, really, I have never seen /opt/local/bin – /usr/bin for package-manager owned stuff, /usr/local/bin for stuff not owned by the package manager and /opt/<Vendor> for weird things…
Why is there a 'WOW' in the middle of the name?
—I was typing System64 and half way through I just thought: "WOW, nature is beautiful!"
But hey, they exist, so someone had the glorious idea to translate these already terrible names into whatever is appropiate for your localized Windows, and create links for stuff like Documents and Settings. Confusion complete.
https://gist.github.com/dchest/800407/raw/48fd662716b7d446e7...
bad name => earlier limit reach
</synergy>
Okay, it's sounds like a fine idea - having multiple DLL versions, allowing applications to link to them. But look, the idea of DLL was to save memory, where two or more applications accessing them would reuse the same hw memory (if they are not relocated). Now maybe on modern PC's that doesn't matter much (although it's still problematic if two MSVCRT libs are used from two different DLLs).
Anyway, but on mobile devices - memory and storage space are important - so make sure all your apps use the same DLL, so you don't lose to storage space, and it's loaded only once (virtually for every process, but due to COW only once in memory).
Have fun, go to Best Buy/Costco/anywhere where they sell the Windows RT/Pro tablets. Go to the command prompt (cmd.exe), c:\windows\winsxs, and type "dir /s" - you can see how much space is wasted there. And this would get even more and more with more updates coming.