5 ms·
The colon has been special since the dawn of DOS. For instance, you cannot use "con:" as a file name. (In fact, in a fit of extreme stupidity, DOS also claimed
by kazinator 10y ago
The colon has been special since the dawn of DOS. For instance, you cannot use "con:" as a file name. (In fact, in a fit of extreme stupidity, DOS also claimed some devices with no Colon suffix, like "con" and "prn", effectively making these into globally reserved names in any directory.)
Stock Cygwin does something special with the colon character, so the Cygwin git shouldn't have this problem. A path like "C:foo.txt" is not understood by stock Cygwin as a relative reference in the current directory of drive C; the colon is mapped to some other character and then this is just a regular one-component pathname.
In the Cygnal project (Cygwin Native Appplication Library), paths passed to library are considered native. So that certain useful virtual filesystem areas remain available, I remapped Cygwin's "/dev" and "/proc" to "dev:/" and "proc:/", taking advantage of the special status of the colon to take this liberty. You can list these directories (opendir, readdir, ...) and of course open the entries inside them; but chdir is not allowed into these locations. (Unlike under stock Cygwin, where you can chdir to /dev). chdir is not allowed because then that would render the library's current working directory out of sync with the Win32 process current working directory, which would not be "native" behavior.
- dboreham 10y agoThe colon pre-dates DOS by a long time. I seem to recall it in RSX-11 pip. Definitely it was present in CP/M : https://en.wikipedia.org/wiki/Peripheral_Interchange_Program https://en.wikipedia.org/wiki/Peripheral_Interchange_Program
- kazinator 10y agoI used CP/M with a Z80 coprocessor card on an Apple II. I didn't know RSX-11 also had pip, though.
- blastrat 10y agoPeripheral Interchange Program. Gary Kildall recreated PIP for CP/M because he had come from using Digital/DEC systems. It wasn't just RSX-11, it was in a bunch of PDP stuff going back. It was a pretty "revolutionary" feature of Unix that device I/O was just in the filesystem along with everything else so all software could access devices. (Not claiming revolutionary as in invented, revolutionary as in one of the things that helped unix achieve ubiquity and would be the first place most people saw it. Maybe it came from Multics, I don't recall.) Without filesystem mapped I/O, you need to create peripheral interchange programs to do ordinary things like copy files and print. Once you get used to PIP style file specification on command lines, it's a next step to push it into the OS API, so CON: will always mean the console, rather than only to software like PIP. This is the origin of MS-DOS having those special names too. And colon as a special character in a file specification (I didn't say filename) is not just Windows, it's also in Unix (that's where it came from in http:), that's why I'm astonished to hear that people are naming files with colons in them. It used to be, there were more experienced people you worked with who would teach you very quickly that you don't put colons in filenames. Those days are gone, it's emojis all the way down, including some very sad emojis.
- kazinator 10y agoWhere are there colons in Unix, other than as separators in /etc/passwd, PATH, termcap entries and such? Berners-Lee may have gotten http: from volume naming in the classic MacOS or Amiga, or other systems. In Unix, devices were always actual bindings in the filesystem space.
- blastrat 10y agoI don't recall when/where it came from, but for example the unix mount command uses "path ::= name colon path" delimiting for things like NFS and other "protocol based rather than physical disk" filesystems. And along the lines of what you say, yes it could have been borrowed, but probably from PIP even if it was indirectly via CP/M, Amiga or whatever.
- jfroma 10y agoThis annoys me few times 7 years ago, and I never searched the reason :) I remember I was maintaining few vb6 applications and I often tried to create a "con.udl" file just to trigger the wizard and windows just complained with an error that didn't make any sense. So, I started to use conn.udl. A bit late, but is good to know. Here is an screenshot on a Windows 7: https://dl.dropbox.com/s/qg5fxx01mnktw79/ss-2016-07-20T17-19-06.png?dl=0 https://dl.dropbox.com/s/qg5fxx01mnktw79/ss-2016-07-20T17-19... Edit: add screenshot
- kazinator 10y agoI'm surprised it's a problem even when the suffix .udl is present.
- dfox 10y agoThat's useful feature when you actually want to use the special names and the program in question insists on slapping an extension to any filename it uses (I remember printing outputs from various DOS based EDA tools by using export to postscript or hpgl and saving the result as "prn.ps"/"prn.lst").
- naz 10y agoI remember when any attempted access to c:\con\con would bluescreen any windows machine. Hours of teenage fun sending people to a website I'd set up with <img src="file://c:\con\con">
- tonyarkles 10y agoYou could do it over Windows File Sharing too! \\someone-elses-machine\c\con\con would blue-screen their machine!