Live data from Hacker News

I'm “still afraid to use spaces in file names” years old

twitter.com

221–230 of 817 posts

Re: I'm “still afraid to use spaces in file names” years old

#221
post #190
post #173

Earlier quoted context omitted.

"Documents and Settings" still exists on Windows 10, as a soft link to "Users".

You know, this makes me wonder.. tangentially speaking- I wonder how hard it would be to rearrange the folder structure in linux so that I have something like this: /Users/{root, user0, user1, ... }... /System/{Logs, Apps/{opt, container, ...}, Temp, Conf ...}... /Devices/{Mount, sda, sdb, null ...}... /Boot/...

You monster!

Re: I'm “still afraid to use spaces in file names” years old

#223
post #113
post #86

Earlier quoted context omitted.

The shell ought to be able to help with that. There's no need to remember if it's --conf or --config if you can press --conf . One of the things I like about Fish is that by default it can tab-complete program options and also shows a one-line description of what each of them does. (It grabs that info from the man page).

So much of computing is dedicated to solving problems that could be omitted.

I mean, that's precisely my thoughts on copyright and licensing in general but what can you realistically do?

Re: I'm “still afraid to use spaces in file names” years old

#224
post #190

Earlier quoted context omitted.

You know, this makes me wonder.. tangentially speaking- I wonder how hard it would be to rearrange the folder structure in linux so that I have something like this: /Users/{root, user0, user1, ... }... /System/{Logs, Apps/{opt, container, ...}, Temp, Conf ...}... /Devices/{Mount, sda, sdb, null ...}... /Boot/...

You monster!

Don't even get me started on /usr/local/bin..

Re: I'm “still afraid to use spaces in file names” years old

#225
post #145

I have an uneasy feeling whenever I see a path parameter declared as string. Path is not a string - it's a sequence of path components and should be treated as such by our APIs. A path should be parsed once - on user input - and then used in its "sequence form" throughout the software stack. And "path component" is not an arbitrary string either - e.g. appending a path component to the path should first require conve…

"Path is not a string - it's a sequence of path components and should be treated as such by our APIs." For maximum correctness, you want to turn it into a file handle as soon as possible, and do all operations through the variations of the file functions that end in "at", like: https://linux.die.net/man/2/openat The downside of this approach is that you still technically have to carry the path around with you if you…

Why not just hold onto both? The users representation and the file handle. Only ever "display" the representation, while you do all operations on the handle. (Not trying to be sarcastic, just curious).

Re: I'm “still afraid to use spaces in file names” years old

#227

Define " space ". Is the Hangul filler we talked about yesterday a spacing character? Is the zero-width non-breaking space a spacing character? What about the typographic spacing characters? You should better be very afraid of using spaces in filenames. You should do everything you can to support them but you have to know you'll invariably encounter countless cases where you'll have this or that tool that won't work…

You get all those space characters working and then some jerk comes along and uploads a file like this: ŗ̶̧̢͓̳͍͙͔̳̻̥͉̭͓̫̟͍̞̭͉͓͉̮̹͍͚̳̹̬͉͚̰͈̘̐̊̾̈̀̒͒̀͛̓̋̔͊̏͘̚ę̴̨̛̣͙̤̟̬̩̟͙͖̥̹̱̱̊͑͗̇̇͛̆̈́̃͋̓̀̔̍̍̌̐͊̎̓̅̀̕ͅģ̴̹̜̘͍̱̑͐̉̌̐̄̊͛̎́̐̌̅̈́͂͑̈́̋̔͂̊̊̒̒̔͛͆̚͘̕͠e̶̙͕̫̳̘͐̾́̑͆̓͂̿͊̊̍͛͐̌̆͗̌̅̅̔͊̂͛͗̅̕͝͝͝͝x̵̢̧̦̫͖̝̥̹͓̬͖̤̩͚̝̫̋̃̅̈́̆͋̌͑́̎̈́̊̾͒̀̒̎̓͛͊̿̓͊̀̍͐̆̚͝͝-̴̨̮̯͖͖̠̜̲̪͕̘͈͖̮̈́̓̐̃́̅̄̏́̍̉̐͌́̔̓̄͋͗̐̕͜͝ţ̴̢̧̖̗͖̞̮̫̦̼̝̺̼̱̳͓͉̜̟̤̲͖̻͙́̌̈̌̈͆̾̄͊̿̏̓͗̈́̕͜ͅh̶̽́͊̎͐͌̆̍̎̏̕͝…

Honest question - what the heck are those characters?

Re: I'm “still afraid to use spaces in file names” years old

#228

Earlier quoted context omitted.

yep, I still don't use spaces. I also don't use uppercase characters. Just underscores or hyphens.

Sometimes I break the rule and use uppercase but never spaces.

I've had issues when moving between Window/*nix file systems, where Windows file names are case insensitive and *nix systems are case sensitive.

Build script works fine locally on Windows, but then chokes in *nix test server, as it's effectively a different path.

Re: I'm “still afraid to use spaces in file names” years old

#230
I still find them annoying, doing lots of work on the command line. I use this hack:

  #!/usr/local/bin/sbcl --script
  (load "~/.sbclrc2")
  (require 'replace-all)
  (in-package :replace-all)


  (format t "file is ~s" (second sb-ext:*posix-argv*) (probe-file (second sb-ext:*posix-argv*)))
  (let* ((args sb-ext:*posix-argv*)
    (orig (second args) )
    (newfn (if orig
      (replace-all orig "(" "-") 
      orig))
    (newfn1 (replace-all newfn ")" "_"))
    (newfn2 (replace-all newfn1 " " "-"))
    (newfn3 (replace-all newfn2 "&" "-"))
    (newfn4 (replace-all newfn3 ":" "-")))
    (when orig
 (format t "renaming \"~a\" to \"~a\"~%" orig newfn4)
 (multiple-value-bind (new-name old-truename true-newname)
  (rename-file orig newfn4)
   (format nil "new-name ~a old-true ~a new true ~a" new-name old-truename true-newname))))
Post reply on HN