4 ms·
> any *nix script or program that doesn’t handle spaces in files names is woefully buggy. On the contrary! It is filesystems that support plain spaces in file
by enriquto 7y ago
> any *nix script or program that doesn’t handle spaces in files names is woefully buggy.
On the contrary! It is filesystems that support plain spaces in filenames that are broken. Filenames are variable names. Allowing separators in them is bonkers. I make a point of carefully crafting my scripts to wreak havoc whenever a user has spaces in their filenames.
- anoncake 7y agoGREATI~1.DEA
- michaelmrose 7y agoFile names are an interface used by normal people to name files. Teaching everyone to name their files differently seems unlikely to succeed. There is no particular reason your shell can't distinguish between a space inside a filename and the space between tokens in output. The fact that you have to do anything at all yourself is a bug.
- enriquto 7y ago> File names are an interface used by normal people to name files. Teaching everyone to name their files differently seems unlikely to succeed. Sure. But there's no reason why typing the spacebar on a GUI to input your filename should produce a file with a plain space on the filesystem. It could be a unicode non-breaking space, for example.
- anoncake 7y agoThat would just make working with files programmatically harder. The issue isn't that file names contain spaces but that we use programming languages that use spaces to separate fields/entries instead of proper data structures.
- enriquto 7y agoDo these languages allow spaces in their variable names? Filenames are the variable names of shell scripting.
- oalae5niMiel7qu 7y agoWrong. Shell scripts have actual variables. They start with $. Filenames are one possible value you might store in these variables.
- DonHopkins 7y agoFunny how you just say these things as if they were true, without them being true, or any evidence. If you want to be pedantic, Unix has ALWAYS allowed ANY character in file names, except for "/" (unless you have a GatorBox). You once said: "Raw spaces in filenames are an abomination that make shell scripting unnecessarily difficult." No, bash is an abomination that makes shell scripting unnecessarily difficult. Prohibiting spaces in file names seems to be an obsession with you. (How about tabs? ;) You've said you don't see why people should be able to name their files anything they want, and that your reason for prohibiting billions of people from doing what they want is to make your bash scripts simpler. Then simply don't use bash, instead of trying to change the world. Read what I replied to you when you said that 7 months ago, and tell me if the world has changed so much since then that you're right this time around: https://news.ycombinator.com/item?id=19952668 https://news.ycombinator.com/item?id=19952668 Slash is the ONLY character you're not allowed to have under Unix. There are no good reasons to disallow spaces. Disallowing characters in file names that you're allowed to have solves absolutely no problems, it only causes them. There used to be a bug in the Gatorbox Mac Localtalk-to-Ethernet NFS bridge that could somehow trick Unix into putting slashes into file names via NFS, and Unix would totally shit itself when that happened. That was because Macs at the time (1991 or so) allowed you to use slashes (and spaces of course, but not colons), and of course those silly Mac people, being touchy feely humans instead of hard core nerds, would dare to name files with dates like "My Spreadsheet 01/02/1991". https://en.wikipedia.org/wiki/GatorBox https://en.wikipedia.org/wiki/GatorBox I just tried to create a file name on the Mac in Finder with a slash in it, and it actually let me! But Emacs dired says it actually ended up with a ":" in it. So then I tried to create a file name with a colon in it, and Finder said: "Try using a name with fewer characters or with no punctuation marks." Must be backwards compatibility for all those old Mac files with slashes in their name. Go figure! If you think nobody would ever want to use a space or a slash in a file name, then you should get out more often and talk to real people in the real world. There are more of them than you seem to believe!
- a1369209993 7y agoOr, you know, a underscore, as has been de-facto standard for deacades?
- DonHopkins 7y agoBZZZT! You have just violated the Principle of Least Astonishment. https://uxplanet.org/the-principle-of-least-astonishment-bc3f67991510 https://uxplanet.org/the-principle-of-least-astonishment-bc3...
- DonHopkins 7y agoFunny how he would criticize users who want to use spaces in their file names, instead of shells that make it practically impossible for programmers to support spaces in file names.
- thanatropism 7y agoWat
- deleted 7y ago[deleted]