TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The tale of aux.c

217 pointsby uyoakaomaover 7 years ago

18 comments

badsectoraculaover 7 years ago
So, all that text to tell people he is refusing to rename a single file? :-P<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&#x27;t remember, but the files weren&#x27;t created) and when i tried to build the engine it didn&#x27;t work - i thought that i forgot to add the files, rebooted to Linux, forced a re-add, back to Windows and nothing again.<p>Eventually it clicked that &quot;con&quot; 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&#x2F;h` (or `xxx_yyy.c&#x2F;h` where yyy is a subsystem or specialization) and i really prefer the `con_` prefix to the `csl_` one. So far i&#x27;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.
评论 #15337817 未加载
drfuchsover 7 years ago
So, you smug Linux guys think it can&#x27;t happen to you? Well, before you get off my lawn, let me tell you a story...<p>Early versions of FrameMaker kept all resource files (internationalized strings, dialog box layouts, etc.) in the two subdirectories ...&#x2F;FrameMaker&#x2F;Resources&#x2F;{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.<p>But one new customer was calling in a panic. They&#x27;d installed the product, and it would work fine, but the next morning, it wouldn&#x27;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 &quot;core&quot; <i>and</i> had it essentially do a &quot;rm -rf&quot; even though no true core file could be a directory. So, every night, our Core resource directory was blown away.<p>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.
评论 #15335917 未加载
评论 #15335873 未加载
评论 #15337811 未加载
评论 #15335740 未加载
评论 #15338327 未加载
评论 #15335730 未加载
评论 #15338611 未加载
评论 #15339242 未加载
评论 #15336794 未加载
评论 #15337804 未加载
Grom_PEover 7 years ago
On Windows, paths can be accessed with \\?\ prefix:<p><pre><code> mkdir \\?\V:\con notepad \\?\V:\con\aux.txt </code></pre> 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).
评论 #15336401 未加载
spullaraover 7 years ago
In 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&#x27;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.
评论 #15335456 未加载
评论 #15337780 未加载
feelin_googleyover 7 years ago
If I had to guess I would bet that none of the commenters in this thread have ever used the Heirloom version of &quot;mailx&quot;, and some have never used, or would ever want to use, the BSD mailx either.<p>It is a shame because I think Mr. Ritter deserves more recognition for his work.<p>IMHO, some of his versions are real improvements over the BSD ones, e.g., troff (doctools) and nailx.<p>I for one am very thankful for the Heirloom Project and very glad to see it live on.
评论 #15338070 未加载
pcwaltonover 7 years ago
We ran into this issue in Servo too. <a href="https:&#x2F;&#x2F;github.com&#x2F;servo&#x2F;servo&#x2F;issues&#x2F;1226" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;servo&#x2F;servo&#x2F;issues&#x2F;1226</a>
评论 #15335367 未加载
评论 #15335017 未加载
评论 #15335082 未加载
评论 #15335002 未加载
condescendenceover 7 years ago
&gt;But nowadays, people confuse Microsoft Windows, the successor to DOS, with a Unix operating system, and want to run mailx on it.<p>...huh<p>&gt;If you want to use mailx, there is the technically and morally sane option of using a free Unix implementation.<p>I mean it&#x27;s really not that hard to release a Windows compatible version. You change a single file name?<p>This just sounds like throwing gas on the flame war that is unix vs windows.
评论 #15337039 未加载
评论 #15335493 未加载
billpgover 7 years ago
Is 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?
trothamelover 7 years ago
Even if Microsoft keeps this behavior, I&#x27;m surprised they don&#x27;t modify it to check the filename extension. It&#x27;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.
评论 #15335148 未加载
评论 #15335173 未加载
评论 #15338650 未加载
tasty_freezeover 7 years ago
This 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.<p>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&#x27;t make sense. After rewinding recent changes to a point where I knew it used to compile, it still refused to compile.<p>Finally I figured it out. During debugging, I created two copies of log file, one called &quot;old&quot; and one called &quot;new&quot;. Somewhere in an include file (which probably included other files, etc), there was a statement &quot;#include &lt;new&gt;&quot;. Rather that picking up the library source code, it tried to interpolate the contents of the local file &quot;new&quot; during the compile phase.
评论 #15336743 未加载
tedunangstover 7 years ago
Every time I read this I have to wonder how many windows users are really interested in running mailx.
pjc50over 7 years ago
See also <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12129647" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12129647</a> &quot;Git for Windows accidentally creates NTFS alternate data streams&quot;
Theodoresover 7 years ago
I came from a BBC Micro background and found MS-DOS to be a step backwards from what I knew. I couldn&#x27;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&#x27;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.<p>What I had not realised before reading this article was that the file system was as flat as Acorn&#x27;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 &#x27;personal computing&#x27; was a tragedy, holding computing back &#x27;decades&#x27; rather than enabling a better world.
评论 #15336449 未加载
D-Coderover 7 years ago
Does anyone remember Basic-4 systems?<p>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 &quot;CR&quot; (customer report or credit report, who knows). It disappeared on the new system because it was mistaken for the Card Reader.
libeclipseover 7 years ago
Lol, a huge wall of text because the OP doesn&#x27;t want to rename a single file.<p>Jeez.
评论 #15337341 未加载
评论 #15338770 未加载
dustingetzover 7 years ago
&quot;{S &#x2F;con&#x2F;con&quot; in AOL chat used to BSOD everybody&#x27;s computers - {s was a directive to play a sound
评论 #15352326 未加载
JosephRedfernover 7 years ago
What happens if you create a file called aux.c under a different OS, and then mount the drive on Windows?
评论 #15335474 未加载
评论 #15335530 未加载
richard_toddover 7 years ago
I wonder if the restricted names are still with us in ReFS? I don&#x27;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.
评论 #15336206 未加载