17 ms·
Why Does Windows Really Use Backslash as Path Separator?
- ChrisSD 7y agoIt should be noted that Windows can use either forward or backward slashes nowadays. In fact, even File Explorer allows you to use an unholy mix of the two.
- Doubl 7y agoYes I'd noticed this once or twice and momentarily wondered why there wasn't a problem. I hadn't realised it was now officially ok
- Stratoscope 7y agoIt's useful to distinguish between command line and GUI apps vs. the operating system itself. Forward slashes and backslashes have been supported as path delimiters all the way back to MS-DOS 2.0 when hierarchical directories were first introduced. The DOS and Windows file APIs never cared which you used. It was only command line and GUI apps that (rightly or wrongly) preferred one or the other. The only new thing here is that some of these apps have finally started to recognize either delimiter. That is a tricky thing for a command line app where the wrong slash may be interpreted in a way the user did not mean. For GUI programs there was never a good reason to not accept both, e.g. in a file path field.
- dfawcus 7y agoAs I recall, so could / would DOS - at the Int21 syscall level. The SWITCHAR option was present to set a value which COMMAND.COM (and other DOS utils) consulted such that one could make it honour '-' as the flag leader, and then accept '/' at COMMAND.COM (and other DOS utils). Unfortunately not all third party utils honoured that, and so it usually ended up not being worth flipping it in to Unix compatible mode. That said, one could take advantage of the recognition of '/' in programs one wrote, e.g. C code (so avoiding "directory\\file.txt").
- spc476 7y agoINT 21h, function 37h could be used to get and set the switch character for MS-DOS, in addition to requiring the use of '/DEV/' for device filenames: * AL=0, return switch character in DL * AL=1, set switch character to character in DL * AL=2, return '/DEV/' setting in DL * AL=3, DL=0 if '/DEV/' required, DL<>0 if not. Okay, why do I remember this stuff? I haven't programmed MS-DOS for over 25 years!
- duxup 7y agoI accidentally typed the a mix once and noticed it when I hit enter. I honestly expected a blue screen... and I probabbly would have accepted that as the proper outcome of crossing the streams. But it worked. I'm still not sure how I feel about it working...
- blattimwind 7y agoNow mount your NTFS volume on Linux and create a directory named "foo\bar", then a directory "foo" and a directory "bar" inside "foo".
- AdamGibbins 7y agoWhat happens?
- ithkuil 7y agoNot sure. I'd expect the "foo\bar" created on that NTFS volume while mounfed from Linux to be effectively unreachable when accessed from windows (at least while the command line?). Or not. Surprise me.
- ahakki 7y agoWorks without issue. Just went to the Store, downloaded Ubuntu LTS 18.4 and tried it. Screenshot: https://1drv.ms/u/s!AqSptDJA-vctqs4OGewT6Qa-PWBvbw https://1drv.ms/u/s!AqSptDJA-vctqs4OGewT6Qa-PWBvbw
- Jetroid 7y agoI think the intention was that 'foo/bar' and 'foo' would be in the same directory, therefore when typing C:\foo/bar into the file explorer you would have an ambiguous path. Perhaps I misunderstood.
- Zancarius 7y agoYou can create file names containing special characters from ntfs-3g that make it nearly impossible to access or remove from within Windows (such as those containing a "?" character). I'm sure there's a way, but neither the command prompt nor Windows Explorer know what to do. Opening such files from a variety of test applications seems to fail as well. According to the ntfs-3g FAQ, this is expected behavior[1] and is a consequence of NTFS' namespace implementation. Allegedly, such files could be removed via a Samba client, but I've never tried. I confess that outside mounting the disk under Linux, I know of no first party solution to remove or rename such files; but, I'm also not especially knowledgeable on Windows internals. [1] https://web.archive.org/web/20090207135653/http://ntfs-3g.org/support.html#posixfilenames2 https://web.archive.org/web/20090207135653/http://ntfs-3g.or...
- kazinator 7y agoEvery Microsoft operating system going back to early versions of MS-DOS can use / as the separator. This is not necessarily true of the "user space" of Microsoft systems. Paths are not only traversed by the "kernel", but also manipulated by applications like the Explorer shell, which may or may not like forward slashes.
- ChrisSD 7y agoAs I recall at least some parts of the WinAPI had trouble if you used long paths (via "\\?\") and forward slash. I don't know if that's still true.
- kazinator 7y agoIndeed. "Windows API" is very broad; it encompasses all sorts of user-space middleware, some of which could very plausibly munge paths in ignorance of forward slashes.
- mortehu 7y agoIt's partially the opposite. Some system calls only accept backlash, but user space programs and libraries may abstract this. E.g. LoadLibrary, which is similar to execve/dlopen.
- dataflow 7y agoIt should also be noted that you should NOT get in the habit of doing this because the command prompt is not really amused by you doing this. (Try running foo/bar.exe.)
- ChrisSD 7y agoTry it again with Powershell...
- psyklic 7y agoInterestingly, "unholy mixes" of slashes only always work properly in old Windows paths! I found this out when debugging an open source project where '/file.txt' (hardcoded as a forward slash) was appended to a "\\?\" path. Microsoft introduced "extended paths" to accommodate Unicode and paths longer than 260 characters (i.e. "C:\<256-char string>"). These can be prefixed by "\\?\", which sadly does not support slash mixes. Rust's standard library `canonicalize` function, for example, returns "\\?\" paths! (* EDIT: I originally wrote some historical inaccuracies, see ynik's reply below for the corrections. Thank you ynik!) From the docs: "File I/O functions in the Windows API convert "/" to "\" as part of converting the name to an NT-style name, except when using the "\\?\" prefix." - https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation https://docs.microsoft.com/en-us/windows/desktop/FileIO/nami...
- deleted 7y ago[deleted]
- ynik 7y agoThe "\\?\" extended-length paths have existed for a long time; I think since Windows 2000 at least. The Windows kernel and NTFS have always supported paths up to 32k characters; only the Win32 path normalization logic was limited to MAX_PATH. The "\\?\" prefix skips the normalization logic, thus allowing apps to use the full path length. The Windows 10 change in 2016 is something different: if an application opts in (via manifest) AND the LongPathsEnabled registry key is set, long paths will be supported by some (not all) Windows API functions even without the "\\?\" prefix. These new long paths support a mixture of slashes just fine.
- vbezhenar 7y agoThis is some incredible level of compatibility. Cudos to MS stance on that subject.
- Dylan16807 7y agoTo be extra pedantic, it's 32k code units, so some characters take up two.
- b_tterc_p 7y agoI confess, I use them interchangeably and don’t know which one is “correct”
- other_herbert 7y agoJust as long as you don't say backslash when saying a URL... that is one of the things that really brings out the pedant in me...
- A2017U1 7y agoNo tab completion in shells for forward slashes though :(
- thatfunkymunki 7y agoI think tab completion for forward slashes works in powershell
- DonHopkins 7y agoI accidentally found out something mind blowing about Mac OS/X recently: The Finder apparently lets you use "/" in file names! I expect you won't believe me, so try it. Now look at the file in the shell with "ls". Go figure! Now who's unholy???
- thristian 7y agoClassic Mac OS allowed filenames to contain every character except the directory-delimiter, ":". When Mac OS X came around, it included a POSIX API and kernel (so applications expect to be able to use ":" in filenames), but used the same filesystem as Classic Mac OS which didn't allow ":" but did allow the POSIX directory separator "/", which POSIX apps wouldn't try to use in a filename. And so at some layer they were switched around - if you try to create a filename with "/" in the GUI, it's presented as ":" to POSIX; if a POSIX app creates a filename with ":" it shows up as "/" in the GUI.
- mixmastamyk 7y agoBecause "/" was already used as the command switch character in DOS 1.X which didn't yet have folders ((boggle)). Source traced back to DEC TOPS-10, which MS founders were exposed to. Then a conservative manager (piece blames IBM) chose backwards compatibility over consistency with Unix, thereby dooming billions of regular folks to need an explanation what a backslash is compared to a slash.
- PhasmaFelis 7y agoI know we all love bagging on Microsoft, but insisting on backwards compatibility with the system you're directly replacing is not an unreasonable decision, especially since changing it could well have made DOS 1.1 scripts silently destroy data when run in DOS 2.0.
- tssva 7y agoThey were actually bagging on IBM which occurs less often but is probably equally loved.
- mixmastamyk 7y agoThat's what the lesson here is about, I believe. That a reasonable decision in the short-term can be unfortunate in the long-term. Taking lumps for a few months when the userbase was miniscule compared to what it is today sounds more reasonable now.
- cat199 7y agoRealize you are somewhat summarizing, but: "compatibility with unix" didn't matter in those days. There were many, many OS's, all running on computers so expensive (for whichever micro/mini/mainframe segment) that most people didn't expect to replace them, ever. cpm vms tops10 tops20 unix multics rsx11 mvs os/360 gcos apple dos etc etc etc.
- mixmastamyk 7y agoThe article mentions Xenix, to be more specific.
- u801e 7y agoIt would be nice if they would allow one to view the text instead of showing: Please turn JavaScript on and reload the page.
- dangus 7y agoIt would also be nice if we didn't have to read complaints about being unable to view websites from users that disable browser features that they clearly understand will break a lot of websites.
- voldacar 7y agoWebsites that require javascript to display basic text/image content are poorly designed
- anoncake 7y agoIt would be nice if web developers were responsible enough that disabling Javascript were not necessary. It would be even nicer if the web were designed with a semblance of sanity.
- a1369209993 7y agoIt would also be nice if browsers didn't by default auto-execute malware served by any random website, to the point that people think it isn't the website's fault that it breaks when said auto-execution is disabled.
- codedokode 7y agoNo, you should not intentionally hide text from those who prefer to disable JS. Disabling JS improves site load speed and reduces memory consumption. As a side effect, most of ads and trackers also stop working.
- celticninja 7y agoMy organisation has a requirement that we build to work without JS. If we need to use JS for something then we also need a non-JS alternative, the result may be less pretty/fast/require an extra call but it works regardless of your JS choices
- lousken 7y ago...and ofc cloudflare gets in the way and forces you to turn on js
- bitwize 7y agoBecause DOS used the slash as a switch specifier, aping popular DEC operating systems of its day, but did NOT adopt DEC's approach to specifying paths and subdirectories, opting for a more Unix-like approach in DOS 2.0. And Windows inherited a lot of DOS baggage.
- seanmcdirmid 7y agoCP/M had nothing to do with DEC, and digital research had nothing to do with DEC either. What was the DEC connection? Did VMS use backslash for paths?
- syntheticnature 7y agoPer the article, DEC's TOPS-10.
- tapland 7y agoCan't say how it was back in the day but we use something like [HOMEDIR.SUBDIR2.SUBDIRC] on OpenVMS now.
- kragen 7y agoIntergalactic Digital Research's CP/M was a very close copy of DEC RT-11, though not quite as close a copy as MS-DOS was of CP/M, so CP/M had a great deal to do with DEC. VMS, which came later and is therefore irrelevant, used . to separate directory names in paths.
- PhasmaFelis 7y agoHow did TOPS-10 handle directories? The article says "Note that the odd numbers in square brackets [27,5434] are the TOPS-10 way of specifying directories," but doesn't give any more detail. I am shamelessly uninterested in poring over the linked TOPS-10 manual to find out, so I'm hoping you know. :D
- skissane 7y agoThe numbers are a "project programmer number", or PPN. The "project number" is like a bit like a GID, and the "programmer number" identifies the user within the project (so a bit like a UID). A lot of early operating systems didn't have hierarchical directories. It was common to have either one single directory for the whole volume (like CP/M and DOS 1.0 had), or else a two-level structure in which each user gets their own directory but no nesting of directories is allowed. TOPS-10 PPN's are like that.
- goldcd 7y agoWe killed it - https://web.archive.org/web/20190524202002/http://www.os2museum.com/wp/why-does-windows-really-use-backslash-as-path-separator/ https://web.archive.org/web/20190524202002/http://www.os2mus...
- goldcd 7y agoNot usually one to plug stuff - but the Wayback Machine browser extension is very useful for "This is down, would you like to see a snapshot" (or "This is up now for now, would you like it snap-shotted"... or my favourite "I can't believe they put this up, let me ensure this is preserved for evidence if somebody decides to re-write history")
- liability 7y agoI use it, but I've been considering uninstalling it due to frequent false positives where I get redirected to the archive when the original is not actually down.
- stesch 7y agoRemember that one time Linus (Linus Tech Tips) criticized the Apple Mac because it uses slashes as path separator?
- gruez 7y agolink?
- stesch 7y agohttps://www.youtube.com/watch?v=HUiIisJqt1g&t=7m45s https://www.youtube.com/watch?v=HUiIisJqt1g&t=7m45s
- jandrese 7y agoOldschool Macs used colon ':' as the separator. It was not ideal for commandline use because you need to hold shift to type a colon, but in the strictly mouse oriented world of old Finder it wasn't an issue for end users.
- bqqyz 7y agoNot ideal, well... I have a Spanish keyboard and, to type \, I have to press AltGr+º (which is the key next to 1) ;P
- Sharlin 7y agoHeh, in the Finnish layout ':' is actually the easiest of the three to type. Still requires shift but at least you don't have to reach or use both hands. The layout (like most European ones I guess) is pretty horrible for technical work of any sort, there's so much reaching to the number row while holding shift or AltGr...
- suff 7y agohttps://blogs.msdn.microsoft.com/larryosterman/2005/06/24/why-is-the-dos-path-character https://blogs.msdn.microsoft.com/larryosterman/2005/06/24/wh...
- th0ma5 7y agoHeh, I guess it is still also seen as an escape because the title of this blog just has double quotes with no backslash.
- StevePerkins 7y agoHonestly, it actually DOES make sense to use separate characters for directory-delineation versus option switches. There was no way of knowing in 1982 that UNIX was going to take over the world. That everything from corporate mainframes, to desktop PC's, and even phones would rally around the conventions of this largely academic OS.
- enneff 7y agoUnix wasn’t academic. It was pragmatic from the start. A first-hand account: https://youtu.be/EY6q5dv_B-o https://youtu.be/EY6q5dv_B-o
- kazinator 7y agoAlso, Bell Labs wasn't a university, and Thompson and Ritchie were not tenured lecturers. They wrote assembly code, not papers.
- kragen 7y agoThey wrote papers too (Bell Labs was, after all, a research lab), took sabbaticals, and lectured at universities. I think one of the group (Kernighan?) took a sabbatical at Berkeley that was one of the events that gave rise to BSD?
- pjmlp 7y agoUNIX was academic, because Bell Labs were forbidden to make profit out of it and thus licensed it via a symbolic price to universities alongside source code tapes. Had Bell Labs been allowed to sell it, and history would have turned a very different path concerning UNIX clones and its adoption.
- deleted 7y ago[deleted]
- jiveturkey 7y agobetter question: why does my Ford navigation use backslash as the alternate street name separator? unbelievably irksome to me.
- firethief 7y agoBecause Windows has made \ so common that many normies now consider it the forward slash. In the encounters with them I fail to evade, I often hear them referring to the slashes in URLs as "backslash". Shudder.
- octorian 7y agoI thought normies considered \ to be the "computer slash". (Which basically explains all the verbal misuse)
- simonsays2 7y agoIirc Aaron Reynolds said it was done simply to be distinct. A way to reduce the chance of lawsuit.
- drfuchs 7y agoI always thought it was so that file names could have dates in them: BUDGET_09/12/1982.XSL
- gothroach 7y agoI don't recall a time when you could use / in Windows file or directory names.
- jolmg 7y agoSo Windows forbids other characters in names besides the directory separator? EDIT: Apparently: https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names#31976060 https://stackoverflow.com/questions/1976007/what-characters-...
- deleted 7y ago[deleted]
- jonhohle 7y agoIIRC, different APIs in Windows handle special characters for filenames differently. This was probably around the Windows 98 timeframe, but I remember several instances when extracting zips (probably WAREZ) where the file that was written contained characters that Explorer couldn't handle correctly. It wouldn't allow moving those files to the Recycling Bin, but would typically allow renaming the portion before the extension. I had a collection of `zzzz.???` files for a long time.
- Sharlin 7y ago17-character file name, what madness is that? At best you could do BUDG0912.XSL or BU091282.XSL or something.
- ncmncm 7y agoWe're talking about MacOS now. It was really common back then to put dates in file names, and names could be 32 characters long. Furthermore, you didn't need an extension because every file had a separate 4-byte (binary, but usually ASCII anyway) type.
- AnIdiotOnTheNet 7y agoInteresting path component separator trivia: Classic Macs actually had one despite not having a command line interface, it was ':', with '::' meaning "parent directory" and ":::" meaning "grandparent directory". RISC OS used '.' as a separator, with '@' meaning "current", '^' "parent", and '&' "home"; I can hear the "everything should be POSIX" crowd screaming in agony. RISC OS could also address drives by letter or name.
- saagarjha 7y agoAnd for this reason you still can't name your file ":" in Finder today.
- ComputerGuru 7y ago$PATH breaks under most implementations even under Linux or BSD with that. It shouldn't; though.
- wahern 7y agoThat's because the only special characters in file paths in Unix are / and NUL. You can't pass NUL through environment variables, both because of the C API for manipulating environment variables and how the environment is passed to the host program by the kernel--environment variables are delimited by NUL, as are argv arguments, and the argv and environ lists are delimited by a double NUL. So the shell had to pick some random delimiter, and whatever it chose would conflict with existing path semantics. Fortunately, it only effects the semantics of PATH--the colon is irrelevant everywhere else, and PATH isn't strictly necessary for anything, not even in the shell. There's no easy way to fix that. I suppose PATH could instead be split into PATH_1, PATH_2, PATH_3, etc, with a single path per environment variable. I've used such a solution to emulate arrays for both internal and environment variables. But that ship sailed a long time ago: the semantics of PATH are built into the shell, libc (because libc's execvp, etc are what traverse $PATH looking for an executable, not the kernel), countless other programs, not to mention the POSIX standard itself.
- kurtisc 7y ago
- chungleong 7y agoAnd who decided it makes sense to list the parent's name first?
- rubbingalcohol 7y agoThat makes the hierarchy sortable. Same applies to dates - you can sort 2019-05-24, but not something like 5/24/2019.
- kazinator 7y agoThompson and Ritchie, who carried it over from Multics to Unix. They worked on Multics, and that OS introduced the hierarchical filesystem. DOS just copied Unix, right down to the | piping, and < > redirection, and . and .. directory links which are fake. Navigation of a path requires that the parents be traversed before children. For instance resolving /usr/bin/ls means we locate the root directory node, then navigate through usr and bin, finally resolving to ls. The components are written in order of traversal, and that order is left to right because English is written left to right. When /usr/bin/ls is passed to the kernel, it's in a character string which is referenced by a pointer to its beginning: it's pointing at the / in /usr. It is natural to process it in that order: visiting the characters in / u s r / b ... order just requires incrementing the pointer byte by byte from the starting value. There are other reasons to have the most major part near the beginning. A telephone number's country code and area code details coming first allows the network to begin make appropriate switching decisions before the dialing is complete. Imagine you had to dial someone's "extension 42" before the company phone number. That extension would have to be stored somewhere, until the company's PBX picks up the call, because that extension only makes sense in the context of that switch. Also, if we collect the absolute path of every object in the file system, and then sort it lexicographically, the parent to child order means that things in the same directories end up nicely listed together.
- trn 7y agoSee https://en.wikipedia.org/wiki/Path_(computing)#Representations_of_paths_by_operating_system_and_shell https://en.wikipedia.org/wiki/Path_(computing)#Representatio... for a very incomplete list of examples. Also "." was extremely common, used on large DEC systems (RSX, VMS) and Tandem/NonStop as home systems like RISC OS. Multics and VOS use '>' as the separator (and '<' to indicate the parent). The Multics-style paths really are the cleanest, in my opinion. Edit: We run the Public Access Multics system at https://ban.ai/ https://ban.ai/
- daemonhunter 7y agoWhy the "Checking your browser" part? Seriously, its a wordpress blog.
- zippergz 7y agoThat's a cloudflare thing.
- deleted 7y ago[deleted]
- ComputerGuru 7y agoIt's because CloudFlare gates access to half the internet and get to decide whether you're considered a good actor deserving of access to a website (someday, they hope, the internet) or not.
- JensRex 7y agoAparently I'm a bad actor, because the "checking" page never redirects to anything. Guess the author doesn't want people to read his site. I'll comply.
- p4bl0 7y agoSo this is very interesting, but doesn't go into the next obvious question: why did TOPS-10 use forward slashes as command switch?
- eschaton 7y agoThat was a general DEC-ism, not just a TOPS-10 thing.
- neurotrace 7y agoSo let's follow it to the end. Who first started using slashes that way and why?
- kragen 7y agoYou probably want to read https://news.ycombinator.com/item?id=20007305 https://news.ycombinator.com/item?id=20007305 and https://news.ycombinator.com/item?id=20007259 https://news.ycombinator.com/item?id=20007259.
- aap_ 7y agoProbably TOPS-10, or rather the PDP-6 Monitor (which later was renamed TOPS-10)
- ape4 7y agoNow Windows is embracing Linux with WSL and of course URLs use forward slashes. It would be so great if they switched to forward slashes.
- optymizer 7y agoafaik Windows has supported forward slashes for a very long time (I want to say at least since WIN 2K). Discussion here: https://bytes.com/topic/python/answers/23123-when-did-windows-start-accepting-forward-slash-path-separator https://bytes.com/topic/python/answers/23123-when-did-window...
- kragen 7y agoSince MS-DOS 2.0, when MS-DOS added a hierarchical filesystem.
- maxxxxx 7y agoYou can use forward slash quite a bit but there are a lot of exceptions.
- terandle 7y agoThe newline mess is a bigger problem imo
- oaiey 7y agoYeah. Unix should finally fix it :). CarriageReturn + LineFeed. That is correct :) Inventing new ways after the typewriter. Tss. These young people :)
- Lowkeyloki 7y agoIt's hard to imagine a time before hierarchical file systems.
- jandrese 7y agoIt's from a time when the media was so small there was no need to categorize anything because the entire directory listing fit on a single screen in most cases. Stuff ended up being characterized by what disk it was on (floppy labeled "homework" vs. "games") rather than where it was in a filesystem. Directories were only necessary once Hard Drives appeared and you could centralize your storage.
- saalweachter 7y agoAnd now we're kind of coming out the other side, where storage is so large and can contain so many items that organizing it all into a hierarchical structure is a full time job in itself. MP3s can mostly sort themselves, but your pictures ... and then you have the N-layer-deep "old computer" directories, where you copied all the files from your last computer to your new computer.
- jandrese 7y agoThese days every desktop environment integrates an increasingly featureful fast search feature front and center because they know you aren't going to be able to keep up.
- chrisseaton 7y ago> It's hard to imagine a time before hierarchical file systems. Have you seen how most non-technical users manage files on their desktop?
- Theodores 7y agoIt was hard to understand hierarchical file systems if you started out using non-hierarchical file systems. I write from experience using Acorn ADFS on the BBC Micro. You get into a way of working with what you have. With ADFS the files could be put in directories but these were single letter prefixes to file names. You could not change into a directory and, once one's mind was thinking the ADFS way, the idea of a sub directory with further sub-directories was as conceptually difficult as it is to imagine what 5D space looks like. The way regular users save files to the downloads folder or the desktop with no sub directories is different. What they are doing is quite sensible for their workflow. This is an extension of 'search don't file', which is Gmail ethos for what to do with your mail. In previous times 'search don't file' wasn't viable for email. You had to create rules and sub folders. Gmail enables you to do that but it is productive for people who don't do that due to the search. Traditionally Windows was useless for finding files with search, taking too long and showing you some cartoon dog whilst it chuntered through files slowly, with no command line 'grep' power tools. So you had to 'file' rather than 'search'. ChromeOS and Android are 'post files' systems to an extent. ChromeOS has moved on from desktop computing of old. I am not one to knock casual Windows/Mac users that 'instinctively' work the ChromeOS/Gmail way. Of course I would hang, draw and quarter any programmer that didn't save files the UNIX way, i.e. in folders with no spaces or other weird characters in filenames.
- devit 7y ago... and why did TOPS-10 start using / as the option separator?
- userbinator 7y agoUltimately it's essentially an arbitrary choice, but the reasonable set of characters would exclude letters and numbers (too widely used for filenames already), be already available in the character sets of the time, and not too awkward to type nor look at. That means it'll be one of the special and non-paired (like parentheses) characters, and beyond that any single one would do. Beyond that, any one is as good as the others. We could've just as easily ended up in a world where options are introduced with \ and path separators are commas, or any number of other combinations. It's a little funny to think that the TOPS-10 developers probably spent less than a day in total deciding on the character, far less than the time spent by everyone else since then thinking about why they did it that way.
- TheOtherHobbes 7y agoI doubt it was a day. I'd be surprised if it was more than a minute or two. TOPS-10 subdirectory separators were commas, but the path was enclosed in [] so it was always clear which part was a path and which part was something else. UNIX and DOS/Windows made a big mistake by removing the enclosing characters, and TOPS-10 was a 6.3 file system that never used them to their full extent. The (back) slashes and switches weren't the biggest problem. Spaces in file paths were - and sometimes still are - hard to deal with. A standard pair of enclosing characters would have eliminated a lot of unnecessary and unreliable escape character logic, and would also have allowed almost all other characters to be used without problems.
- GordonS 7y ago> A standard pair of enclosing characters would have eliminated a lot of unnecessary and unreliable escape character logic Windows allows you to enclose paths in double quotes, which deals with the space problem. Off the top of my head, I don't recall if Linux has the same behaviour?
- phaedrix 7y agoCan't seem to find it now, but I recall reading somewhere that Paul Allen said it was the worst decision he made in the early days.
- makecheck 7y agoDone to avoid errors, then we proceed to put the "\" key directly above Return/Enter and incur errors for decades to come. :) Early in my career I did this from the command prompt while typing a recursive remove command and basically auto-torched a much higher directory tree thanks to my backslash-equals-return typo.
- Narishma 7y agoAnd that's only if you're lucky to use a qwerty keyboard layout. On other layouts, the backslash requires a combination of keys to produce.
- tssva 7y agoWe should all just be grateful they didn't copy the file and drive conventions from TRSDOS which was the operating system for Tandy's TRS-80 line of computers. Like MS-DOS file names were 8 characters with a 3 character extension however the extension was separated not with a period but a forward slash. Also files could have a password which was separated from the name/ext by a period. Disk drives we're referenced by numbers, 0-7, and separated from the name/ext.password by a colon. For example copying a file from one drive to another could look like "copy ascii/txt.foofum:0 ascii/txt.feefum:1". If you wanted a listing of all the txt files on the current drive the command would be "dir /txt". The file system wasn't hierarchical so there was path separator.
- sd_mikey 7y agoOne of the many reasons for the “Trash-80” name.
- tssva 7y agoWhoa, let's not go crazy! Just because the naming conventions, which weren't crazy for the day, would cause issues today doesn't mean you get to call my first child, I mean computer, a "Trash-80". I didn't stand for it then and I won't now.
- ringshall 7y ago" The file system wasn't hierarchical so there was path separator. " Do you mean the opposite?
- tssva 7y agoA typo. It was non-hierarchical so there was no path separator.
- 13of40 7y agoLike the article says, hindsight is 20/20. If it was 1977 and TRSDOS was the only thing that transformed your expensive brick into something capable of copying a file from one drive to another you might be more of a fan.
- deleted 7y ago[deleted]
- anyfoo 7y agoWow, this is a great revelation, and I feel like the lede is almost buried here, namely that DOS seems to have been influenced by TOPS-10 to such a great amount. I wonder how many other DOSisms were in reality TOPS-10isms that had been replicated.
- kragen 7y agoNo, the author is wrong about that.
- sabujp 7y agowe use forward slashes just fine. It's great when you're doing code in python, java, etc and in a cygwin/cmd/powershell environment
- EamonnMR 7y agoPeople constantly use 'backslash' when reading URLs out loud for no reason! It's just a slash!
- ben509 7y agoMy guess is they're using the technical sounding word when they're reading a techy URL thing. Out of curiosity, if we're describing the two characters, which would logically be "down slash" and "up slash"?
- teh_klev 7y agoI might actually upset some folks by saying....who cares, it's just a character? I've worked with many OS's that didn't even have a directory structure, and those that did were only one level deep. And there wasn't a lot of "slashing" going on....DG RDOS for example. Some other OS's had colons (perhaps VMS - I can't remember now. We're talking about a time back in the depths of history where OS's had their own specific quirks. To assume that folks bumping into computing way-back-when encountered Unix regularly and "used slashes" is based on a deeply flawed presumption. Back in the early 80's (and into the early 90's) cheap computing was to be had by the use of CP/M and MSDOS, not Unix because it was too bloody expensive for non-academic use. I used to look after a bunch of SCO 86 boxes in my time (pre-Linus), for the customer these licenses were not cheap compared to say MP/M. My first encounter with Unix and the "forward slash" was in fact in 1986, running on a NCR Tower box (and that's some minor exotica I could go on about...) and to me it was just another thing to remember. So glorifying Unix over its choice of "/" as a directory separator. Really, who cares? I enjoy Unix and Linux, but this hagiography over its greatness ("/") seriously makes me wonder about how folks choose an OS these days to get work done.
- agumonkey 7y agoI wonder how many discussions and meeting were had on the subject of which character to use in those days.
- TheRealPomax 7y ago...did you even read the article? Nowhere does it claim greatness of one over the other, it's simply an interesting piece about a bit of computing history that plenty of people love to learn, because we LOVE trivia.
- teh_klev 7y ago> did you even read the article? https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html Please don't comment on whether someone read an article. "Did you even read the article? It mentions that" can be shortened to "The article mentions that."
- ChuckMcM 7y agoIt is amusing how this sort of stuff evolves over time. Before Microsoft was doing DOS their big product was Microsoft BASIC for the Altair computer. No OS, just load it into memory (from paper tape or cassette tape!) and start it up. Microsoft BASIC was written in 8080 assembler (Bill Gates once pointed this out to me in a meeting). The assembler that was used was called CROSS80 and it ran on both TOPS20 and TOPS10 (DEC10 operating systems for the DEC system that Bill and Paul used at Harvard when writing BASIC) The TOPS-10 command line manual is here : https://livingcomputers.org/Discover/Online-Systems/User-Documentation/Tops-10-v7-04/2_Operating_System_Commands_Manual.aspx https://livingcomputers.org/Discover/Online-Systems/User-Doc... and you will see that on page ix in the conventions used, TOPS 10 introduced command options (switches) with the forward slash character (/switch) The use of / for "options" was a standard part of DCL (the DEC Command Language) here is the document for RT-11 (ftp://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp11/rt11/v5.6_Aug91/AA-PDU0A-TC_RT-11_Commands_Manual_Aug91.pdf) Microsoft was copying DEC because at the time DEC was the most successful MINIcomputer company and Microsoft had aspirations of being the most successful MICROcomputer company. As a result command options (or switches) were preceded by '/' and that gave the parser heartburn if you used forward slash for the path. If you read the RT-11 manual you will see that the COPY command took an option /BOOT to copy to the boot directory, and it was written COPY/BOOT not COPY<space>/BOOT. If a directory was involved it would be FOO/COPY/BOOT and how would you be able to parse that? Bell Labs (also DEC users at the time) switched to using '-' for UNIX to indicate a switch or option because it wasn't a path character. At the end of the day the desire to be like DEC was what gave us both devices with colon's on the end (LPT: anyone?) and logging into the "active" directory. And DEC used slash for options in their DCL so that is what Microsoft used.
- inflatableDodo 7y ago>It is amusing how this sort of stuff evolves over time. One that always gets me is the overlapping window interface being a neat hack in order to demonstrate the concept of a multi-process gui when you are on a mainframe with monolithic memory in 1970, rather than 'how you are supposed to do things'.
- 1wd 7y agoMicrosoft's "BASIC-80 (MBASIC) Reference Manual Appendix D BASIC-80 with the CP/M Operating System" https://archive.org/details/BASIC-80_MBASIC_Reference_Manual/page/n135 https://archive.org/details/BASIC-80_MBASIC_Reference_Manual... shows it used "/" for options. The "Microsoft BASIC Compiler, Version 5.3 July, 1981" manual https://archive.org/stream/BASIC_Compiler_v5.3_1981_Microsoft/BASIC_Compiler_v5.3_1981_Microsoft_djvu.txt https://archive.org/stream/BASIC_Compiler_v5.3_1981_Microsof... says: "The compiler operates under the CP/M operating system" "6.3 COMPILER SWITCHES ... must begin with a slash (/)" "MACRO-80 ASSEMBLER ... 2.2.2 Switches ... must be preceded by a slash" "4.2.1 LINK-80 Switches ... must be preceded by a slash (/) . (With the TEKDOS operating system, switches are preceded by hyphens . See Appendix A.)" "5.2 LIB-80 SWITCHES ... are always preceded by a slash" (The "TRS-80 Manual: BASIC Compiler" https://archive.org/stream/BASIC_Compiler_19xx_Microsoft/BASIC_Compiler_19xx_Microsoft_djvu.txt https://archive.org/stream/BASIC_Compiler_19xx_Microsoft/BAS... says: "3.2.3 Command Line Switches ... Switches are always preceded by a dash ... -Z-4-T" "Filename extensions must be separated from the filename by a slash mark (/) ... /BAS Basic source file" and does not mention CP/M.) "Microsoft FORTRAN-80 Ver3.4 Users Manual" https://archive.org/details/bitsavers_microsoftc0Ver3.4UsersManualNov80_12630629/page/n17 https://archive.org/details/bitsavers_microsoftc0Ver3.4Users... also says switches "must be preceded by a slash" for CP/M, but for TEKDOS (Section 4) "the switches are delimited by commas or spaces instead of slashes"! "Microsoft FORTRAN-80 Users Manual 1977" https://archive.org/details/bitsavers_microsoftc0UsersManual1977_972526/page/n5 https://archive.org/details/bitsavers_microsoftc0UsersManual... also already says "Each switch should be preceeded by a slash (/)". "Section 5 Operating Systems" says command lines are supported on "CPM" and "DTC Microfile", but not on "ALTAIR DOS". "Microsoft COBOL-80 1978" https://archive.org/details/bitsavers_microsoftc978_6774127/page/n135 https://archive.org/details/bitsavers_microsoftc978_6774127/... says: "Each switch must be preceded by a slash (/)" (1.1.2 MACRO-80 Assembler, 2.1.2 LINK-80 Linking Loader) "switches are always preceded by a slash" (3.2 LIB-80 Library Manager) "Section 4 Operating Systems" Command lines are supported on "CPM", "DTC Microfile" and "ISIS-II", but not "Altair DOS".
- kragen 7y agoThis is almost correct, but MS-DOS derives from the DEC small systems line (the PDP-8 and PDP-11), not the large systems line that ran TENEX, which took the name "TOPS-10" in the DEC Witness Protection Program (the PDP-6 and PDP-10). TENEX's only real descendant in modern computing systems is the command-line editing (and filename completion?) in bash and zsh. Much to my surprise, it seems to be true that CP/M did not actually use / for flags, even in PIP, although other incarnations of PIP (like that in Heath's HDOS) did use /. The CP/M 2.2 manual is at http://www.cpm.z80.de/manuals/cpm22-m.pdf http://www.cpm.z80.de/manuals/cpm22-m.pdf and documents the command lines of all the standard utilities, including the assembler, PIP, and the text editor. (It also, in passing, documents the full 8080 instruction set and OS API.) TENEX was born in 1969 but grew up in the 1970s, but the use of / for switches in DEC-land predates it; https://en.wikipedia.org/wiki/Concise_Command_Language https://en.wikipedia.org/wiki/Concise_Command_Language is somewhat confused, but it currently describes how the PDP-6 monitor program used / for switches in, presumably, 1964. DEC operating systems like the ones CP/M aped used / liberally for switches, and third-party programs we used on CP/M certainly did use / for switches. This was not limited to the PDP-10 large systems operating systems; it was also true on OS/8 for the PDP-8, as described in https://www.pdp8.net/os/os8/index.shtml https://www.pdp8.net/os/os8/index.shtml (though, as you can see, some commands used - instead, like the later Unix). The PDP-8 shipped in 1965, but OS/8 might be more recent than that.
- aap_ 7y agoThe author argues that the people at Microsoft were very familiar with TOPS-10 (which is not TENEX btw) and in any case the PDP-8 and -11 OSes would have been inspired by TOPS-10, so you're back to TOPS-10 again.
- kragen 7y agoWell, it's certainly true that Gates and Allen developed Altair BASIC on a PDP-10 (under which operating system I don't know, but it could have been TOPS-10, and you are right that TOPS-10 is not a version of TENEX), but they didn't write MS-DOS; Tim Patterson, at Seattle Computer Products, did. And it's a straight copy of CP/M, not of TOPS-10. (Nor of TENEX.) Later development of MS-DOS happened at Microsoft, but I don't think Gates and Allen wrote any code for it; the last product Gates wrote code for was the BASIC interpreter for the TRS-80 Model 100, which shipped in 1983. I don't think it's accurate to say, "the PDP-8 and -11 OSes would have been inspired by TOPS-10," except in the sense that they were also inspired by the IBM 360 and other systems — ideas did cross-pollinate, of course, but circumstances conspired to prevent especially strong cross-pollination in this case. The PDP-8 predates TOPS-10 by two years, so there is a substantial amount of software for the PDP-8 that could not have been inspired by TOPS-10 — including, I think, early versions of OS/8 — and RT-11 and RSX-11 followed OS/8 rather closely, especially at first. And, as I understand it, inside DEC, the small-systems folks (the PDP-7, -8, and -11) were organizationally separate from the large-systems folks (the -6 and -10), I think in geographically separate locations.
- deleted 7y ago[deleted]
- elchupanebre 7y agoI used to work on PDP-11 under RSX-11M and it used forward slashes as option separators. For example the equivalent of ls: pip /li