14 ms·
The tale of aux.c
- pcwalton 9y agoWe ran into this issue in Servo too. https://github.com/servo/servo/issues/1226 https://github.com/servo/servo/issues/1226
- uyoakaoma 9y agoMe as well while cloning linux on windows
- lambda 9y agoYou run into different, but similar, issues cloning Linux on macOS as well, since HFS+ is case-insensitive by default (and looks like the same is true of APFS), but the Linux source has filenames that differ only in case (don't ask me why).
- JoshTriplett 9y agoSame thing in Cargo: http://sasheldon.com/blog/2017/05/07/how-i-broke-cargo-for-windows/ http://sasheldon.com/blog/2017/05/07/how-i-broke-cargo-for-w... https://github.com/rust-lang/cargo/issues/3982 https://github.com/rust-lang/cargo/issues/3982
- catwell 9y ago... and the Linux kernel itself. https://bugs.eclipse.org/bugs/show_bug.cgi?id=509072 https://bugs.eclipse.org/bugs/show_bug.cgi?id=509072 I learned about this when I added cloning the Linux kernel repository to an integration test suite for a cross-platform filesystem. I had to use another project because of that file :)
- steveklabnik 9y agoI ran into it while trying to clone the source for Minix, just to poke around and read the code. (I think it was COM and not AUX but same principle)
- loeg 9y agoThe pirate scene occasionally hits this as well (copies of the film "Con Air" which would be named "Con.Air.<foo>" by convention were instead named "Con_.Air" or "Con_Air" etc. All thanks to the legacy CON device.
- monochromatic 9y ago> But my answer is: No, I will not deface the mailx source code in order to make life easier for customers of a vendor of non-Unix systems who chose to clutter his directory name space with useless entries. I will especially not do so as this vendor has threatened free software on several occasions. > The Heirloom Project is oriented at the Unix tradition, and it is free. If you want to use mailx, there is the technically and morally sane option of using a free Unix implementation. You are on your own if you choose against it. This guy sounds like a real pain in the ass.
- DiabloD3 9y agoIt doesn't even make sense to hold this position. Aux.c isn't even a usefully descriptive name for a file you'd find in a mua.
- tyingq 9y agoA legacy requirement to not ever have any files with a basename of CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, or LPT9 doesn't make sense either :)
- russellbeattie 9y agoI was wondering what the full list was. Thanks!
- cesarb 9y agoIt's more complicated than that, that's just the list of forbidden base names, but there is also a list of forbidden characters, and many other rules. This MSDN article has all the details: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...
- Iv 9y agoFrom 2007. Back when Microsoft really was at war with OSS and called Linux a cancer.
- trothamel 9y agoEven if Microsoft keeps this behavior, I'm surprised they don't modify it to check the filename extension. It's one thing to change a device like CON that people might expect to exist, but it seems like not distinguishing CON and con.c is just asking for trouble.
- dfox 9y agoThat behavior is intentional and is workaround for programs that does not let user change file extension on saving.
- ploxiln 9y agoThe funny part is, that is not the purpose at all any more. It was probably only for a handful of years that this trick was needed to "trick" programs which thought they were saving a normal file and forcing the correct extension to actually use a printer or serial port. No one has used a printer or serial port by File -> Save As to "lpt.txt" in decades! Now it's just because some code hidden away under 10s of layers a millions of lines in some obscure line-of-business applications is accidentally dependent on this quirk and "it works now" and no one will ever fix it.
- kevin_thibedeau 9y agoThis isn't an issue for contemporary human facing UIs. Somewhere there is guaranteed to be a crusty POS system still in use that is sending receipt data to LPT.TXT or AUX.TXT.
- flukus 9y agoThey could remove it in a new version of windows, that crusty POS system is going to be doing a lot of testing before they upgrade the version of windows it's running on. Even more likely is that they'll never upgrade from whatever ancient version they're using so it won't affect anyone. I think they just keep it because it feeds into the backwards compatibility myth that MS has built up.
- tedunangst 9y agoEvery time I read this I have to wonder how many windows users are really interested in running mailx.
- Grom_PE 9y agoOn Windows, paths can be accessed with \\?\ prefix: mkdir \\?\V:\con notepad \\?\V:\con\aux.txt This avoids reserved filenames as well as 260-character length restriction. But many programs that try to do any path processing fail after seeing an unexpected prefix, even File Open dialog (on Win7 at least).
- pjmlp 9y agoIt was finally fixed on Windows 10.
- ethomson 9y agoLength was, maybe. Reserved device names (like CON, AUX, etc) are still reserved.
- pjmlp 9y agoI was referring only to length.
- Dylan16807 9y agoNot really. Windows 10 made it easier in certain ways for a program to support long file names. But it still requires explicit support, and programs can and did support it previously. And importantly explorer still doesn't support it properly.
- pjmlp 9y agoIt just requires enabling it, no special care from applications. It is disabled by default due to backwards compatibility. https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa3... The file explorer does not support it on purpose. https://superuser.com/questions/1114359/windows-10-home-anniversary-update-long-path-fix-not-working https://superuser.com/questions/1114359/windows-10-home-anni...
- spullara 9y agoIn 1991 I was working at a place with a Novell Netware network. I decided to make a system that would execute remote commands by writing them to a shared directory and other machines would see the files and execute the commands. I named those files COMXXXXX.TXT where the X's were a random number (yeah, that was a bad idea). Every few days the system would hang and stop working. I finally narrowed it down to the random number being 1-9 that would correspond to the serial ports on the machine and it would then hang.
- tedunangst 9y agoLesson: always zero pad.
- ComputerGuru 9y agoTo be fair, that was not at all obvious from your tersely worded post.
- ComputerGuru 9y agoI’m sorry, I seem to have fat fingered it and replied to the wrong post.
- JosephRedfern 9y agoWhat happens if you create a file called aux.c under a different OS, and then mount the drive on Windows?
- tedunangst 9y agoNothing. Maybe. The magic happens in open() or createfile() (or a little underneath there, precisely). Nothing about the disk format prohibits such names, and they're accessible via other pathnames. But if you have a program that lists files and then tries to open each one automatically, it may have a bad time. I would hope AV software has tested this scenario, but AV software.
- sophacles 9y agoThis is the type of question that leads to new classes of exploit... well thought!
- emerged 9y agoExcept it's one of the first things each of the thousands (likely more) of professional and hobbyist hackers have already tried after learning about this particular OS quirk
- feelin_googley 9y agoIf I had to guess I would bet that none of the commenters in this thread have ever used the Heirloom version of "mailx", and some have never used, or would ever want to use, the BSD mailx either. It is a shame because I think Mr. Ritter deserves more recognition for his work. IMHO, some of his versions are real improvements over the BSD ones, e.g., troff (doctools) and nailx. I for one am very thankful for the Heirloom Project and very glad to see it live on.
- sevensor 9y agoI know of him through the version of vi that comes with Arch. I really appreciate that there's somebody keeping a conservative version of vi around. Even if I'm mostly going to use vi-like editors with more features, I'm glad there's a vi to fall back on.
- condescendence 9y ago>But nowadays, people confuse Microsoft Windows, the successor to DOS, with a Unix operating system, and want to run mailx on it. ...huh >If you want to use mailx, there is the technically and morally sane option of using a free Unix implementation. I mean it's really not that hard to release a Windows compatible version. You change a single file name? This just sounds like throwing gas on the flame war that is unix vs windows.
- chungy 9y agoYou can even work around it without renaming the file. Cygwin and LXSS for example allow the use of file names such as "aux.c" without any changes to the mailx source.
- jstanley 9y agoIt was written in 2007. There was much greater tension between Microsoft and free software at that time.
- condescendence 9y agoyeah I just noticed that, good point. Although releasing as much OSS/Free software to every OS (regardless of status) would have been a better fighting route than "*uck you."
- mafsedan 9y agoThis is from 2007. Things have changed
- drfuchs 9y agoSo, you smug Linux guys think it can't happen to you? Well, before you get off my lawn, let me tell you a story... Early versions of FrameMaker kept all resource files (internationalized strings, dialog box layouts, etc.) in the two subdirectories .../FrameMaker/Resources/{Unix,Core} (the first one for the Unix platform-specific resources, and the second for the cross-platform ones also used by the Mac and Windows ports). We had hundreds of happy customers, and had been shipping for 4 years or more. But one new customer was calling in a panic. They'd installed the product, and it would work fine, but the next morning, it wouldn't even start up, and they had to re-install it. And then it would break again over night. After much pulling of hair and gnashing of teeth, it turns out that due to some other flakey product they were running, they had previously instituted a nightly cron job that ran around removing any core files it could find (since they were large and wasteful of precious disk space back in the day). And the knucklehead who wrote the script had it do a case-insensitive match on "core" and had it essentially do a "rm -rf" even though no true core file could be a directory. So, every night, our Core resource directory was blown away. We actually had to change the product, as this was a big, important customer, and they outright refused to fix their cron script. Never had this problem on the Windows and Mac ports.
- hossbeast 9y agoHow is this specific to Linux?
- drfuchs 9y agoOk, "unix-derivative" if you prefer. FWIW, it actually happened on SunOS or maybe HP-UX, and it was before Linux existed.
- flukus 9y agoBut it could have just as easily been a windows batch file, it's not related to the OS at all.
- kieranelby 9y ago
- D-Coder 9y agoDoes anyone remember Basic-4 systems? I transferred several programs, in those days and on that system with a maximum of six characters for the name, from one machine to another via magtape. One was named "CR" (customer report or credit report, who knows). It disappeared on the new system because it was mistaken for the Card Reader.
- richard_todd 9y agoI wonder if the restricted names are still with us in ReFS? I don't have one handy to check it on, but it seems like if there were ever a good time to break backwards-compatibiliy, ReFS would be it.
- colejohnson66 9y agoThe restriction isn't in the filesystem. You can mount an NTFS filesystem on a Linux box, create a file called "aux.c", then mount that filesystem on Windows. See also: https://news.ycombinator.com/item?id=15335209 https://news.ycombinator.com/item?id=15335209 and https://news.ycombinator.com/item?id=15335474 https://news.ycombinator.com/item?id=15335474
- dom0 9y agoWith default mount options you can even create files/folders named foo\bar.
- badsectoracula 9y agoSo, all that text to tell people he is refusing to rename a single file? :-P I encountered that issue a few times in the past, most recently when a couple of years ago i was writing the console support for my 3d game engine and made two files called `con.c` and `con.h`, checked them in to version control and then at some point (much) later synced it on the Windows side. Fossil (the VCS i use) simply skipped that file (maybe it complained? i don't remember, but the files weren't created) and when i tried to build the engine it didn't work - i thought that i forgot to add the files, rebooted to Linux, forced a re-add, back to Windows and nothing again. Eventually it clicked that "con" is a bad word in Windows filesystems, so i simply renamed the files to `csl.c` and `csl.h` :-P. I found this a bit irritating because my naming convention follows a mostly rigid pattern where `xxx_` prefixed functions will always recide on `xxx.c/h` (or `xxx_yyy.c/h` where yyy is a subsystem or specialization) and i really prefer the `con_` prefix to the `csl_` one. So far i've kept the `con_` prefix and made a special note for that in the readme file where i explain the naming conventions, but every time i have to use or work with that part of the engine i feel the irritation :-P.
- cup-of-tea 9y agoI found it an interesting and well-written piece of history.
- tasty_freeze 9y agoThis is an entirely different mechanism, but was bitten not long ago by a surprising feature of the C++ language. It was as surprising to me as I imagine saving a file to aux.c would be. I was working on a C++ program, editing, compiling, debugging as one does. After a while, my efforts to compile were stymied due to a flood of weird compiler errors that didn't make sense. After rewinding recent changes to a point where I knew it used to compile, it still refused to compile. Finally I figured it out. During debugging, I created two copies of log file, one called "old" and one called "new". Somewhere in an include file (which probably included other files, etc), there was a statement "#include <new>". Rather that picking up the library source code, it tried to interpolate the contents of the local file "new" during the compile phase.
- deleted 9y ago[deleted]
- Theodores 9y agoI came from a BBC Micro background and found MS-DOS to be a step backwards from what I knew. I couldn't believe how naff MS-DOS was and how lazy the coders must have been to make it so primitive. I also found PC vendors to be lazy too, it wasn't as if any of them made an effort to do any code to improve on matters, they just shoved the same old MS-DOS in the box. What I had not realised before reading this article was that the file system was as flat as Acorn's ADFS, i.e. no hierarchy. How this joke of a product came to take over the world and take us from networked computing to standalone 'personal computing' was a tragedy, holding computing back 'decades' rather than enabling a better world.
- Triave 9y agoADFS allowed directories, but used "." as the separator, giving you paths like "Letters.Memo1". Were you thinking of DFS?
- MatthewWilkes 9y agoBoth DFS and ADFS used .
- Theodores 9y agoYou couldn't do hierarchy though, it was only one deep.
- to3m 9y agoThat was true for DFS, but not ADFS.
- billpg 9y agoIs this when I get to complain about operating systems that allow spaces in filenames which also have a shell language that makes it difficult to use those files?
- libeclipse 9y agoLol, a huge wall of text because the OP doesn't want to rename a single file. Jeez.
- wruza 9y agoMost of that text explains the often forgotten issue, it is only the last paragraph that tells his preferences. I didn't even know that CP/M was sane in its naming scheme and thought it was CP/M legacy, not Microsoft's madness. Pretty informative, though not much surprising.
- Sean1708 9y agoTo be fair most of it was quite interesting, but those last two paragraphs felt really out of place.
- pjc50 9y agoSee also https://news.ycombinator.com/item?id=12129647 https://news.ycombinator.com/item?id=12129647 "Git for Windows accidentally creates NTFS alternate data streams"
- dustingetz 9y ago"{S /con/con" in AOL chat used to BSOD everybody's computers - {s was a directive to play a sound
- rasz 9y agoyou could do the same thing to Internet Explorer with simple image link