Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Almost every CLI program I've ever used in Windows has no problem with spaces in filenames, so I don't exactly ...

Just to clarify on what we think as problem could differ:

    C:\Users\hzhou>ls *.txt
    new  2.txt

    C:\Users\hzhou>ls new  2.txt
    ls: new: No such file or directory
    ls: 2.txt: No such file or directory


dir works fine for that.

:)

I actually didn't know that dir supported multiple globs for filenames! I've never had a need for that.

Super cool.


Um... no it doesn't. It takes each space delimited name as a new name. You will need to add "" and quote the names -- but Windows shell only has one level of quoting, (") which means you can't easily type the command you need. Unix shell is a bit better. Unix only appears worse because people do attempt scripting.

Directory of C:\Users\fred

12/14/2017 04:44 PM 1,556 new 2.txt 1 File(s) 1,556 bytes 0 Dir(s) 75,989,876,736 bytes free

C:\Users\fred>dir new 2.txt Volume in drive C has no label. Volume Serial Number is BA05-C445

Directory of C:\Users\fred

Directory of C:\Users\fred

File Not Found

C:\Users\fred>


> Um... no it doesn't. It takes each space delimited name as a new name. You will need to add "" and quote the names -- but Windows shell only has one level of quoting, (") which means you can't easily type the command you need. Unix shell is a bit better. Unix only appears worse because people do attempt scripting.

Ah I see, you have a file "new 2.txt", I was a bit confused.

Not sure what you mean by only 1 level of quoting being a problem, sorry.


> Ah I see, you have a file "new 2.txt", I was a bit confused.

This is highly ironical, given this thread.

Some people seems to advocate for programs to be better than humans at globbing filenames.


That's a great point. Computers sure have the potential to deal with spaces just fine. But if textual interaction is a requirement, we can only have one of arbitrary filenames and clutter-free syntax.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: