Live data from Hacker News

Why is the DOS path character "\"? (2005)

web.archive.org

121–130 of 166 posts

Re: Why is the DOS path character "\"? (2005)

#121
During the time DOS 2.0 was in development, I visited Microsoft with a group of colleagues. (We were touring computer manufactures both in Seattle and in Silicon Valley (where we visited Digital Research, Intel and many others—in those days it was comparatively easy to visit these enterprises for a tour.)

We were at Microsoft quite some hours (and we seemed important enough to be fed lunch which consisted of very good sandwiches). One of the people who toured us around was a DOS developer (who in his 'spare' time also contributed to the Flight Simulator development). He spent considerable time discussing the new DOS subdirectory matter as it was a hot topic back then. Anyway, he received somewhat of a tongue-lashing from us about the backslash 'problem' and it was very clear to us that he too was not in favor of it although for obvious reasons he chose his words carefully.

This brings me to more ergonomic problems that Microsoft has never bothered to solve with its operating systems—DOS or Windows. The first I'll mention is the annoying reserved character problem, specifically: : " / \ | ? * cannot be used in a filename. I'm aware these characters are also deemed illegal in the filenames of other operating systems but I fail to see why after about 30 years that we still have to worry about avoiding them. If Microsoft had fixed the problem back then, then there would have been pressure for other operating system developers to also fix the problem. Just because other operating systems were behind the times, it didn't mean Microsoft had to be—after all, in the early days, Microsoft went to considerable trouble to please users in the useability stakes, even to the extent that it put security severely at risk in the process.

I fail to see why Microsoft couldn't have coded around this problem and allowed the use of these characters. It went part of the way by allowing spaces within filenames in Windows and it also allowed spaces to be entered into the command line filenames with quotes "My first Name.doc". The fact that these characters cannot be used has caused considerable trouble for IT staff over the years.

It'd hate to think how many thousands of hours have been wasted by both users and IT staff over the past three decades or so on what ought to have been a trivial matter to fix. Similarly, I hate to think how many times I've had to enter a ¿ into a filename just because the damn operating system will not let me enter normal question mark: ?.

Another major stuff-up is the maximum filename length/max path length of 254/255 - 260 when the path length could be potentially 32,767 characters—as it already calculates the path to this length internally (the exact length varies between O/S versions). These days, this limit is ridiculous. If, say, you have a file with a filename of say 245 characters long in directory \MyFiles then move the directory way down deep into nested directories then one automatically has a problem that one's not necessarily aware of until a cannot-continue crash occurs during a backup. Having to regularly run a Max-Path-Length utility across the disk to search for potential problems is a damn nuisance and it ought to be completely unnecessary.

Same problem occurs when saving web pages with long names, these often exceed the maximum filename length and the page cannot be saved without manual intervention. To say ≈255 characters for a filename is long enough is just not being realistic these days. Here's another instance: say one wants to save a book with a long title from the Internet Archive and to avoid confusion later over having a cryptic filename one adds the book's title to the already-cryptic IA filename, i.e.:

Books..with_very_long_names_are_common_on_the_IA_+_the_Internet_Archive_filename_abcxzy123.pdf

Many a time I've had the title combined with the IA O/S filename exceeds 255 characters, and sometimes it's by a large margin. Shortening the filename at this juncture wastes considerable time, especially if there are many files involved.

Oh, and there's another PIA worth mentioning: .MSI files cannot be loaded from a directory when the directory has a leading blank (space) in its filename whereas an .EXE file can. Now how did that come about (and it's never been fixed)? [Leading spaces in directories are useful as directories and files are automatically sent to the top of the file manager tree—which is a very useful technique I've adopted for years to highlight temporary work files or sorting directories, etc. Again, this is necessary due another operating system limitation, which is that neither DOS nor Windows has any way of allowing a user to order the file/directory structure to meet his or her needs.] Other obvious limitations are that we cannot highlight filenames or directories in that we cannot make them different colors or even have filenames with different typefaces. Why not?

As I've said for years, operating system developers don't care much about user ergonomics. If they did then by now we'd even have a new file system to replace the existing one which is truly antiquated. A new file system would include metadata extension(s) within files that OSes and programs would both understand (but that's a far too big a matter to discuss here).

When one thinks about it, we users really have been shortchanged by the likes of Microsoft and others over the years.

Re: Why is the DOS path character "\"? (2005)

#122

In addition to its use as a path separator in DOS and Windows, the backslash character itself is also interesting because it is very likely a modern invention, with the first attestation in 1940s (!). Its original use in ASCII (1960s) was for ALGOL operator digraphs `\/` and `/\`. Its early use as the C escape sequence (1970s, replacing `*` in BCPL) suggests that it carried no significant semantics at that time.

I feel like some people must have written slashes in whatever direction long before, but it was never formalized until then.

Re: Why is the DOS path character "\"? (2005)

#123

Earlier quoted context omitted.

NT originally had a Unix subsystem: https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem

Yeah, and WSL1 was something similar, but I was suggesting just Unix here, no Win32. Imagine GNU/NT!

If someone wanted to attempt this absolute bastardisation of God's will, you could try porting the GNU userland to run atop the ReactOS kernel.

We'd finally have the GPL-licenced microkernel OS of Stallman's dreams.

Re: Why is the DOS path character "\"? (2005)

#124
post #75

Do you correct people when they say “back slash” when reading out a url? When it’s actually a forward slash? Is there a name for this phenomenon? Everyone knows it’s a slash except when its used for something computery. Then it somehow becomes a backslash.

I have to suppress the urge to correct people both when they refer to it as a backslash and when they use the term "forward slash". I've already lost all my friends by being that guy; I don't need to also earn the enmity of random strangers on the internet. But technically it's a solidus not a slash.

Nothing is wrong with "forward slash.

Re: Why is the DOS path character "\"? (2005)

#125

Earlier quoted context omitted.

What special about NT kernel that's not in linux kernel ?

* It is (with a lot of ifs and buts) a microkernel * it is optimized for integration with third party software from people who don’t have the source, so for instance the driver model is interesting * the built in configuration system (the registry) and how it’s used throughout * the (underused) personalities system you can use to show different apis to different binaries * the security model is much more interesting,…

If I'm not mistaken, the Win32 API is actually a subsystem to the NT kernel. You can call the kernel itself a layer below with functions beginning with 'nt*'.

Hardware is actually mapped as an object namespace, which is presented to the user as the drive letters. This was exposed with Windows XP booting in safe mode; during the boot process it would print file paths as object paths, not drive paths.

Much as I'm more in the *nix way now, there's plenty of curiosities to explore and tinker in Windows.

Re: Why is the DOS path character "\"? (2005)

#126

During the time DOS 2.0 was in development, I visited Microsoft with a group of colleagues. (We were touring computer manufactures both in Seattle and in Silicon Valley (where we visited Digital Research, Intel and many others—in those days it was comparatively easy to visit these enterprises for a tour.) We were at Microsoft quite some hours (and we seemed important enough to be fed lunch which consisted of very goo…

> If Microsoft had fixed the problem back then, then there would have been pressure for other operating system developers to also fix the problem.

I don't know about all of the other reserved characters, but the colon is the path-separator character in classic Macintosh APIs and I doubt they would have ever been able to "fix" that.

> To say ≈255 characters for a filename is long enough is just not being realistic these days.

This was a limitation of old APIs and has been possible using the Unicode-aware APIs for a couple decades now, but as of Windows 10 it's possible to use long paths via the traditional APIs as well if an application declares a special manifest flag. Check out "Enable Long Paths in Windows 10, Version 1607, and Later" here: https://docs.microsoft.com/en-us/windows/win32/fileio/maximu...

Otherwise, try using those long paths as e.g. "\\?\C:\Users\Lammy\Downloads\Books..with_very_long_names_are_common_on_the_IA_+_the_Internet_Archive_filename_abcxzy123.pdf"

My number one peeve for a long time was "Documents and Settings" instead of "Users" on Windows XP, but I've come around to that once I realized it was probably intentionally-annoyingly-named to force app developers to use modern APIs since it seems to intentionally break the 8.3 length convention and force you to deal with escaping the spaces.

Re: Why is the DOS path character "\"? (2005)

#127
post #73

Do you correct people when they say “back slash” when reading out a url? When it’s actually a forward slash? Is there a name for this phenomenon? Everyone knows it’s a slash except when its used for something computery. Then it somehow becomes a backslash.

I don't have an answer but it's exactly the same phenomenon as when people refer to '#' as a hash-tag.

everyone knows it's called 'tictactoe'

Re: Why is the DOS path character "\"? (2005)

#128

Earlier quoted context omitted.

Exactly. Everyone knows it's an octothorp.

i've just started calling it "shift 3". that seems to be the least confusing way to communicate the character haha

That will usually work in the US, but Shift-3 returns £ on keyboards configured for the UK!

Re: Why is the DOS path character "\"? (2005)

#129

Earlier quoted context omitted.

Exactly. Everyone knows it's an octothorp.

i've just started calling it "shift 3". that seems to be the least confusing way to communicate the character haha

Is it shift-3 on all keyboards? Maybe it is, but I've seen other keyboard layoutss where symbols are in different locations.

Re: Why is the DOS path character "\"? (2005)

#130
post #41

Earlier quoted context omitted.

You mean like epoll on Linux?

No, like io_uring which Linux got in 2019 and still doesn't cover everything yet (e.g. currently mkdirat() is being added). It also often falls back to a kernel-level thread pool, since many e.g. file systems don't implement async IO.

Annoyingly IOCP didn’t cover everything as well - for example, CreateFile of all things!
Post reply on HN