Live data from Hacker News

The tale of aux.c

heirloom.sourceforge.net

71–80 of 129 posts

Re: The tale of aux.c

#71
post #37

Earlier quoted context omitted.

How is this specific to Linux?

Ok, "unix-derivative" if you prefer. FWIW, it actually happened on SunOS or maybe HP-UX, and it was before Linux existed.

I'm reminded of when I discovered on a production system that "killall" is very different on Solaris to Linux.

Re: The tale of aux.c

#73
post #41

Earlier quoted context omitted.

A more direct (though fictional) illustration that Unix also has reserved file names that you'd better avoid: "I was writing a novel about digging to the center of the Earth, entitled "core". One day I was running some program that crashed, and my novel turned into a bunch of binary gibberish." Or how about: "My video of my kid's first at-bat, in a file I named a.out, got mysteriously clobbered when I took my first p…

If we're going to criticise Unix file naming, I'd rather talk about how file names with spaces in them break things, or how hard it is do delete a file named "-".

>I'd rather talk about how file names with spaces in them break things

Not really a Unix thing, but some tools (rather common even) are indeed very broken when it comes to certain types of file names. However...

>how hard it is do delete a file named "-"

While it's certainly a corner case of sorts, if you call that task hard, I wonder how you fare with using more complex software, like a web browser...

Re: The tale of aux.c

#74
post #65

Earlier quoted context omitted.

There's something in my environment that keeps creating a file called "-" in my home directory, and it's driving me crazy.

By convention, when a unix program is passed "--" it means there are no more flags being passed. Try the following: $ rm -- -

This will not work with all rm implementations, in which case you can fall back to: rm ./-

Re: The tale of aux.c

#75
post #49
post #13

On 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).

It was finally fixed on Windows 10.

Length was, maybe. Reserved device names (like CON, AUX, etc) are still reserved.

Re: The tale of aux.c

#77
post #65

Earlier quoted context omitted.

If we're going to criticise Unix file naming, I'd rather talk about how file names with spaces in them break things, or how hard it is do delete a file named "-".

There's something in my environment that keeps creating a file called "-" in my home directory, and it's driving me crazy.

list the file showing inode number, rm by that particular inode.

Re: The tale of aux.c

#78

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'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 rando…

Lesson: always zero pad.

Be careful with that. Using leading zeros (in KSH) treats them as octal and doing things "old" school will break.

Re: The tale of aux.c

#79
post #41

Earlier quoted context omitted.

A more direct (though fictional) illustration that Unix also has reserved file names that you'd better avoid: "I was writing a novel about digging to the center of the Earth, entitled "core". One day I was running some program that crashed, and my novel turned into a bunch of binary gibberish." Or how about: "My video of my kid's first at-bat, in a file I named a.out, got mysteriously clobbered when I took my first p…

If we're going to criticise Unix file naming, I'd rather talk about how file names with spaces in them break things, or how hard it is do delete a file named "-".

  rm -- -

Re: The tale of aux.c

#80

Earlier quoted context omitted.

Or they could just create a registry flag that enables the backwards compatible behavior. Then all default installs don't have the "bug", while those that need it can enable it.

They could probably make the new behavior opt-in in the application manifest. Without a manifest, you'll see pre-XP common controls, and GetVersion will return an old version, so every modern application has it anyway.

They could even incorporate this into some sort of... Compatibility Mode.
Post reply on HN