LWN.net Logo

Control characters in file names

Control characters in file names

Posted Nov 23, 2010 20:24 UTC (Tue) by jreiser (subscriber, #11027)
In reply to: Control characters in file names by Yorick
Parent article: Ghosts of Unix past, part 4: High-maintenance designs

I don't remember ever having seen a legitimate use of this liberty.

My customers enjoy better performance at lower cost because of the difference (log2(254) - log2(223)), and I make money from that. [Hint: a database index encoded in filenames, accessed only by the database and the backup system.] If you wish to exclude [\x01-\x1f] from filenames that customarily are manipulated by your users and programs, then please write plugins/extensions/whatever to implement this constraint in the command-line shell programs of your choice.


(Log in to post comments)

Control characters in file names

Posted Nov 23, 2010 21:15 UTC (Tue) by Yorick (subscriber, #19241) [Link]

The very point of such a restriction would be that programs would not need to implement it themselves.

I'm somewhat surprised that you believe that 3 % longer file names would make a noticeable difference in performance for your application; have you measured this? Most cases of data encoded in file names that I have come across would happily use something like base64, with the added benefit of portability and easier manipulation and inspection of the directories with standard tools.

Control characters in file names

Posted Nov 25, 2010 16:47 UTC (Thu) by Spudd86 (guest, #51683) [Link]

Well since you don't want it you CAN just turn it off. Fact is that it's almost NEVER sane to have such a file name, and when it is you can disable the restriction.

No one who has proposed the restriction has ever done so as a non-optional, always on thing, on by default, yes, but never as something you couldn't turn off. If you can't ask that people running your app disable a feature of that type, then your app is already broken and you're just waiting for someone to hit the brokenness.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds