Earlier quoted context omitted.
Several positions in the table ({ | } [ \ ] @) were meant for "national variants". I guess those characters were deemed unimportant at the time. Here is some more info: http://www.cs.tut.fi/~jkorpela/chars.html#national-ascii
Thus, the characters that appear in those positions - including those in US-ASCII - are somewhat "unsafe" in international data transfer ... Systems that support ISO Latin 1 in principle may still reflect the use of national variants of ASCII in some details; for example, an ASCII character might get printed or displayed according to some national variant. Thus, even "plain ASCII text" is thereby not always portable…
Why is the DOS path character "\"?
21–30 of 68 posts
Re: Why is the DOS path character "\"?
#22Interestingly, if you ever come to Japan you will find many people expect path separators to be yen symbols (¥). Their windows paths look like: ¥docs¥finance¥ To understand the reason, just check out the table on the Shift-JIS encoding: http://en.wikipedia.org/wiki/Shift_JIS Specifically, look at the character at 0x5C where the backslash sits in ASCII. Learning this was one of those mind-blowing moments when you try…
Re: Why is the DOS path character "\"?
#23Interestingly, if you ever come to Japan you will find many people expect path separators to be yen symbols (¥). Their windows paths look like: ¥docs¥finance¥ To understand the reason, just check out the table on the Shift-JIS encoding: http://en.wikipedia.org/wiki/Shift_JIS Specifically, look at the character at 0x5C where the backslash sits in ASCII. Learning this was one of those mind-blowing moments when you try…
Re: Why is the DOS path character "\"?
#24This article remind me of my first days of C coding and the problems generated with escaped "c:\haracters in strings". After years I still think that the use of forward slash is the worst decision ever. At least Apple chose ":" on Mac OS classic.
Re: Why is the DOS path character "\"?
#25Earlier quoted context omitted.
If you're referring to \ it's a backslash not a forward slash.
A simple way to remember forward/backslash (which I probably read on HN) is the phrase "Backslash is by the backspace" Edit: This is for the standard US keyboard. A more general way of thinking about it, though a bit more to remember: associate "positive" with "forward", and see that '/' has a positive slope. Or just go listen to a BBC podcast, and let the sound of the broadcaster saying "bbc dot co dot uk forward-sl…
Re: Why is the DOS path character "\"?
#26Earlier quoted context omitted.
If you're referring to \ it's a backslash not a forward slash.
A simple way to remember forward/backslash (which I probably read on HN) is the phrase "Backslash is by the backspace" Edit: This is for the standard US keyboard. A more general way of thinking about it, though a bit more to remember: associate "positive" with "forward", and see that '/' has a positive slope. Or just go listen to a BBC podcast, and let the sound of the broadcaster saying "bbc dot co dot uk forward-sl…
Re: Why is the DOS path character "\"?
#27I've had embarrassing MS-DOS moments in the past where I was typing out something like a recursive-delete on a path. If you accidentally hit RETURN instead of a backslash then you can do things like blow away entire parent directories unintentionally. This didn't exactly improve my already-critical view of PCs. :)
Re: Why is the DOS path character "\"?
#28Goes deeper than just IBM. Prior to DOS there was CP/M and CP/M had many programs with an older heritage. For example, it was possible to copy from a source (such as a file) to a destination (such as another file, or an I/O port) using a program called PIP ( http://en.wikipedia.org/wiki/Peripheral_Interchange_Program ). On CP/M, for example, you could print a file with the command (PRN: is the name of the printer dev…
copy file.txt LPT1
she can also print multiple files or results of print to file using the /b switch (binary) ignoring EOFThat also explains why you shouldn't use LPT1 as file name - it was a special name that meant first parallel port. I remember seeing a ridiculing thread about it on HN some time ago
Re: Why is the DOS path character "\"?
#29People use "/" as a date separator as in 12/25/1979 so effectively banning that character as a character in filenames seems a really poor choices. By that metric chosing "\" is a much better choice because "\" is used no where I know outside of computers. I've never encountered it anywhere outside of computers so arguable it's the perfect choice for a path character.
Re: Why is the DOS path character "\"?
#30The early DOS developers wanted to use "/", so it turns out the underlying OS will accept either / or \. The main trouble you have is that cmd.exe and powershell think \ is the switch character -- so as long as you're not writing programs that write shell scripts or shell out you do OK. Back when I was a Windows dev I drove the guys I worked with nuts because I used "/" instead of "\", figuring it would be more porta…
Also, if you really want to make portable C# code, you should use Path.DirectorySeparatorChar, as it's not platform specific at all.
http://msdn.microsoft.com/en-us/library/system.io.path.direc...