|
|
Log in / Subscribe / Register

Leading spaces are common, actually

Leading spaces are common, actually

Posted Mar 27, 2009 5:36 UTC (Fri) by quotemstr (subscriber, #45331)
In reply to: Leading spaces are common, actually by barryn
Parent article: Wheeler: Fixing Unix/Linux/POSIX Filenames

The users on a filesystem I administer use six or seven levels of leading space to sort their common jobs-in-progress directory. I've long since given up on getting them to move to a hierarchical setup.

The way I see it, if a program can correctly work with filenames containing spaces, it can work with a filename containing leading spaces.

It's most important to eliminate newlines and control characters in filenames. The second most important consideration is specifying UTF-8 as the preferred filename encoding. Let's not get caught up in all sorts of other wishes that will just encourage endless debate and prevent these very important changes from getting made at all.


to post comments

Leading spaces are common, actually

Posted Mar 28, 2009 9:21 UTC (Sat) by explodingferret (guest, #57530) [Link]

Leading and trailing spaces *do* have particular problems in shell scripts, because the 'read' command (which is needed to read line-separated data from commands) strips leading and trailing spaces/tabs unless IFS is set and does not contain spaces/tabs.

perl also has problems with leading spaces in filenames, unless you use the right kind of open command (perldoc -f open).


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