I_fucking_hate_them_now

973 points · 144 comments · view on lemmy.world

144 Comments

lemming741@lemmy.world · 195 pts · 336d (17 replies)

Microsoft intentionally made programs install to C:\Program Files on Windows 95+ to force programmers to deal with spaces in filenames.

Someone make one of those "statements made by the utterly deranged" memes about it, please and thank you.

lime@feddit.nu · 79 pts · 335d (14 replies)

what is even more funny about this is that the name of that directory used to be locale-dependent, so in sweden it was just called "Program", completely nullifying that idea.

jjagaimo@sh.itjust.works · 59 pts · 335d (3 replies)

C:\Program Files

C:\Program Files (x86)

C:\ProgramData

some_kind_of_guy@lemmy.world · 54 pts · 335d (1 reply)

C:\PROGRA~1

dosuser123456@lemmy.sdf.org · 1 pts · 325d

me coming back to cmd after spending a month in command.com:

BanMe@lemmy.world · 43 pts · 335d

The fucking parenthetical x86 absolutely kills me. I don't normally wish dick cancer on people,

SomethingBurger@jlai.lu · 9 pts · 335d (9 replies)

It's only localised in the file explorer. The actual folder name is always Program Files.

SorryQuick@lemmy.ca · 9 pts · 335d (8 replies)

Only since vista, it used to be localized.

Appoxo@lemmy.dbzer0.com · 5 pts · 335d (6 replies)

what about placeholders/variables like %localappdata%, %windir%, %programfiles%?

SorryQuick@lemmy.ca · 3 pts · 335d (5 replies)

I can only assume these always existed, otherwise it would have been a nightmare for everyone.

HK65@sopuli.xyz · 2 pts · 335d (3 replies)

Excel used to have, and I think it still has, localised function names.

Makes it a nightmare to look up stuff on the Internet.

lime@feddit.nu · 3 pts · 334d

the entirety of office has localised hotkeys. whaddayamean ^F is "search"? it's for fat text!

Cavemanfreak@lemmy.dbzer0.com · 2 pts · 334d

Still does. Commas or semicolons as separators in functions differ at least. It fucking sucks.

lime@feddit.nu · 1 pts · 334d

nope, that's an NT thing

uniquethrowagay@feddit.org · 2 pts · 335d

Really? That is absolute insanity

sexy_peach@feddit.org · 32 pts · 335d

No this is just clever

Shanmugha@lemmy.world · 7 pts · 335d

Given even what little I know of their history and what they are doing now, I cannot be sure this wasn't the intention at least partially

IcedRaktajino@startrek.website · 111 pts · 336d (40 replies)

I've recently learned that in Linux, you can use emois in filenames. I died a little lot inside when I learned that.

FrostyPolicy@suppo.fi · 81 pts · 336d (19 replies)

On Linux file systems you can use any character except NULL, and / is a reserved character.

E.g. on ext-4 "All characters and character sequences permitted, except for NULL ('\0'), '/', and the special file names "." and ".." which are reserved for indicating (respectively) current and parent directories."

xthexder@l.sw0.com · 58 pts · 336d (14 replies)

I once accidentally created a file with a newline character in it... it was pretty tricky to fix from command line.

malware@lemmy.zip · 86 pts · 335d (6 replies)

tdawg@lemmy.world · 69 pts · 335d

Arrest this person

voodooattack@lemmy.world · 33 pts · 335d (3 replies)

This is absolutely haram

malware@lemmy.zip · 26 pts · 335d (2 replies)

it was on accident, habibi, I swear 😁. I messed up some cmake code for preprocessing .txt ascii sprites into constants and accidentally created this abomination

voodooattack@lemmy.world · 10 pts · 335d (1 reply)

I once made a script to delete .o, .lib, and .so files from my huge dev folder to free up space on my home partition.

It did not go as planned.

Jeremyward@lemmy.world · 7 pts · 335d

O no, o no no no

exu@feditown.com · 15 pts · 335d

This is why you shouldn't parsels output btw. Use find and read instead

GenderNeutralBro@lemmy.sdf.org · 13 pts · 335d

I actually did this a lot on classic Mac OS. Intentionally.

The reason was that you could put a carriage return as the first character of a file, and it would sort above everything else by name while otherwise being invisible. You just had to copy the carriage return from a text editor and then paste it into the rename field in the Finder.

Since OS X / macOS can still read classic Mac HFS+ volumes, you can indeed still have carriage returns in file names on modern Macs. I don't think you can create them on modern macOS, though. At least not in the Finder or with common Terminal commands.

sukhmel@programming.dev · 6 pts · 335d

I created a file with backspace in name, it was hard to understand why filename doesn't match

toynbee@lemmy.world · 4 pts · 335d

I don't conduct interviews very often, but when I do, one of my questions is always about interacting with files that have special characters in the filename.

Warl0k3@lemmy.world · 3 pts · 335d (3 replies)

Did you not just use tab? That's the usual method of dealing with weird characters in filenames that I've found

xthexder@l.sw0.com · 4 pts · 335d

This was quite a while ago now, but I don't think my shell escaped the tab complete properly, I remember it just printing a literal newline and evaluating it as a second command. I think there was other unicode in there too, otherwise I would have just typed it out. I had to do something with null terminated output and piping it in to mv, but I can't remember what exactly.

Hupf@feddit.org · 1 pts · 335d (1 reply)

Too bad when there's multiple files starting with and consisting mostly of e.g. kanji (when on a Latin keyboard).

brotundspiele@sh.itjust.works · 4 pts · 335d

With the right shell, you can just press tab multiple times to cycle through the possible completions.

CanadaPlus@lemmy.sdf.org · 6 pts · 336d (3 replies)

So ... is allowed, or all whitespace, or Zalgo text.

I mean, on the one hand, I guess why be restrictive, but on the other I feel like requiring something that looks like language somehow might be a good idea to avoid edge cases and attacks.

joyjoy@lemmy.zip · 13 pts · 336d

You can have new lines in your file names. YSAP has a good video/playlist about how to deal with these and many more.

Hupf@feddit.org · 3 pts · 335d (1 reply)

could you have .​.? I assume most terminals would just spell out .\x200b.?

CanadaPlus@lemmy.sdf.org · 2 pts · 335d

Or use a hair space so it looks almost the same. Or .. but you've added the right-to-left unicode character. I'm guessing there's something that looks a lot like a period, too.

If ext4 doesn't include restrictions terminals probably should.

rem26_art@fedia.io · 48 pts · 336d

can confirm

Gyroplast@pawb.social · 24 pts · 336d (4 replies)

In filenames? AMATEURS! Use obscure Unicode in your passphrases for maximum security. Ctrl-Shift-U, enter arbitrary code point, bam! 🦊 Works even better with a Compose key and a nice, chonky .XCompose file to throw some gr∑∑k letters around, for instance, like some confused script kiddie. :)

On topic: There are multiple variants of spaces in Unicode. You're welcome, and now go and create something utterly deranged with that information.

wizardbeard@lemmy.dbzer0.com · 6 pts · 335d

I already deal far too much with trying to handle dumb fucking typos in employee data, and trying to turn human names into valid email addresses.

The first time I encounter something like this there will be a body. It will not be found.

Auster@thebrainbin.org · 5 pts · 335d

иnteresting_idéa_lål.ㅅㅇ

luciferofastora@feddit.org · 2 pts · 330d

Some grSSk letters?

Shanmugha@lemmy.world · 1 pts · 335d

This needs more upvotes. Chaos gods smile at you, and I thank you

nialv7@lemmy.world · 17 pts · 335d (1 reply)

unix filenames are just string of bytes, the operating system does not interpret it in anyway. this is a much saner approach compared to Windows where language settings can change file system behavior.

who@feddit.org · 5 pts · 335d

the operating system does not interpret it in anyway.

*in any_way. ;)

bobs_monkey@lemmy.zip · 15 pts · 336d

I'm just gonna pretend I didn't hear that.

Benign@fedia.io · 13 pts · 336d

⏰️.🪵

maxwells_daemon@lemmy.world · 9 pts · 336d

ChatGPT is taking notes

TootSweet@lemmy.world · 8 pts · 336d

10 seconds of googling indicates this is true for Windows and Mac as well. I haven't looked specifically, but I'd be a little surprised if it wasn't true for Android and iOS as well.

But really, why would they add rules to prevent people from using certain unicode codepoints in filenames? Should they disallow Klingon as well? Kanji? Of course not. Emojis are codepoints just like U+0061 is.

Of course there are good reasons to disallow things like newlines and forward slashes in Linux filenames, but what specifically would even be the argument for preventing emojis?

9point6@lemmy.world · 4 pts · 335d (1 reply)

It's all just Unicode

You can have emoji as your WiFi network name too

Kinda interesting to see what older devices do when faced with such a network

SaharaMaleikuhm@feddit.org · 3 pts · 335d

What about an emoji only wifi password?

bigfondue@lemmy.world · 4 pts · 335d (1 reply)
[ removed ]
IcedRaktajino@startrek.website · 2 pts · 335d

Lol, I think that's how I learned it was possible, too. yt-dlp uses the title as the filename, and all of the emojis came along with it. Was trying to rename them from terminal, but couldn't do much when half the filenames started with the fire emoji lol.

Appoxo@lemmy.dbzer0.com · 3 pts · 335d

Same for Windows (11): I just renamed a file to an apple emoji

aaaaaaaaargh@feddit.org · 2 pts · 335d

I think that may be possible for every filesystem supporting UTF-8 encoding.

zqwzzle@lemmy.ca · 1 pts · 335d

You can use emojis for variable names in swift code.

Samskara@sh.itjust.works · 1 pts · 336d

I have been using emoji in macOS for many years. It can be very useful to tag files.

SpaceScotsman@startrek.website · 58 pts · 335d (5 replies)

I\ don\'t\ know\ what\ you\ mean,\ I\'ve\ never\ encountered\ any\ annoyances.

Routhinator@startrek.website · 7 pts · 335d (4 replies)

'I don\'t know what you mean, I\'ve never encountered any annoyances.'

gamma@programming.dev · 7 pts · 334d (3 replies)

Single quotes don't allow any escaping in shell, you need

'I don'\''t know what you mean, I'\''ve never encountered any annoyances'

Or, in Zsh with setopt rcquotes:

'I don''t know what you mean, I''ve never encountered any annoyances'
Routhinator@startrek.website · 6 pts · 334d (1 reply)

Oh right, good catch. That's me shell scripting while in a meeting. 🫠

stefenauris@pawb.social · 4 pts · 334d

Good use of a meeting to be fair

quantenzitrone@lemmings.world · 1 pts · 333d

it works in fish

asdfranger@lemmynsfw.com · 44 pts · 336d (8 replies)
Oh\ come\ on,\ it\'s\ not\ that\ bad

Some shells enclose those types of files within inverted commas. Such that:

> ls
file\ name.md

is instead

> ls
'file name.md'

(I use fish)

Supreme@reddthat.com · 25 pts · 336d (6 replies)

"inverted commas"? single quotes?

asdfranger@lemmynsfw.com · 15 pts · 336d (2 replies)

Yes, I am a weird english.

marcos@lemmy.world · 5 pts · 335d (1 reply)

What is the Old Continent name of those: `

Revan343@lemmy.ca · 6 pts · 335d

On its own, the backtick is primarily used in computing, and so doesn't have an old-timey-English name, nor does the Jargon File mention a Commonwealth Hackish name for it. While there are a variety of other names, I don't think any of them are specific to the UK

When used with a letter, it marks a grave accent; this was its original purpose on a typewriter

abbadon420@sh.itjust.works · 3 pts · 335d (2 replies)

Floating commas

lucg@lemmy.world · 3 pts · 335d (1 reply)

In dutch I've heard them be called flying commas unapologetically (vliegende comma's — ironically has one in it because many plurals need it, it doesn't mark possession)

lord_ryvan@ttrpg.network · 1 pts · 326d

Ik heb nog nooit iemand een ' een vliegende komma horen noemen, wordt dat in bepaalde delen van Nederland meer gezegd?

zero_spelled_with_an_ecks@programming.dev · 2 pts · 336d

I tried to parse the first one but got all confused because there's no closing single quote.

bleistift2@sopuli.xyz · 33 pts · 336d (2 replies)

Are you typing the whole filename by hand? Tab expansion exists, you know?

Truscape@lemmy.blahaj.zone · 16 pts · 336d (1 reply)

If it fucking works...

Sometimes it does. But not always.

kernelle@lemmy.dbzer0.com · 13 pts · 336d

Zsh changed my life, but I still hate escape chars in my command lines for readability reasons

livingcoder@programming.dev · 24 pts · 335d (6 replies)

Now I use lowercase and underscores everywhere.

drmoose@lemmy.world · 9 pts · 335d (3 replies)

Hyphens > underscores for filenames because all web standards prefer hyphens so if you ever want to network your files its a much smoother experience!

livingcoder@programming.dev · 5 pts · 335d

This is what I need, an explicit reason that makes one choice better than another. If hyphens make for a smoother experience, then I'll reconsider my default behavior.

Thanks for pointing out this benefit.

SaharaMaleikuhm@feddit.org · 3 pts · 335d (1 reply)

They suck hard. I use the renpy engine and there you reference file names directly but always lower case and spaces and hyphens turn to underscores. That can cause issues, so I just do underscores in my file names. Don't give damn about the web.

drmoose@lemmy.world · 1 pts · 335d

Yeah I prefer underscores too but kebab case is definitely better for web and general ergonomics. Dash doesnt require a shift hold! Tho I still mix these depeding on tool or existing idioms. One thing for sure is that spaces and capital letters are stupid and we should do less of them.

Anahkiasen@lemmy.blahaj.zone · 5 pts · 335d

This is the best for tab completion, altho I prefer hyphens visually

BassTurd@lemmy.world · 3 pts · 335d

I prefer lowercase with hyphens, but I'm transitioning into a team that does everything camelCase, which is the second best case, but I still strongly dislike it.

cupcakezealot@piefed.blahaj.zone · 20 pts · 335d (5 replies)

the struggle between spaces in filenames look cute and oh fuck what's the code to reference a space in a filename in terminal?

kamen@lemmy.world · 10 pts · 335d (4 replies)

Just put the whole thing in quotes. You might have to escape extra sets of quotes, usually with a backslash.

YellowTraveller@lemmy.zip · 2 pts · 335d

Or you can also put a \ in front of the space

ulterno@programming.dev · 0 pts · 335d (2 replies)

If you intend on using that with tab completions, you will have extra work to do.

kamen@lemmy.world · 3 pts · 335d (1 reply)

Some shells put the path in quotes automatically as you attempt to complete anything with spaces in it.

ulterno@programming.dev · 0 pts · 335d

Yeah, just need to set it up correctly.

callyral@pawb.social · 19 pts · 334d (3 replies)

not sure why the default behavior is this:

file\ name\ with\ a\ bunch\ of\ spaces

instead of this:

"file name with a bunch of spaces"

but you can just press " before pressing tab to auto-complete, and it will use the 2nd form

lord_ryvan@ttrpg.network · 1 pts · 326d

I mean, at least in Bash tools like ls do use quotes by default:

$ ls
 filename_without_space  'filename with space'

But yeah, tab expansion uses backslashes, sadly.

killeronthecorner@lemmy.world · 1 pts · 334d (1 reply)

Because quoting requires token expansion (e.g. ~ to /home/you). Escaping gives you a much shorter path in that case.

That said I'm with you, full quoted paths read better to me.

lord_ryvan@ttrpg.network · 1 pts · 326d

You can use variables in " like so: cd "$HOME/Desktop".

Maybe this helps?

AmazingAwesomator@lemmy.world · 17 pts · 336d (5 replies)

i think i am old. i grew up using DOS, and really hated spaces in filenames and folders because they appreared truncated at the first space with a tilde and index of that file/folder representation.

ex: C:\folder name is bad\ == C:\folder~1

i hated that so much that when i got to windows 3.1 i refrained from using spaces (some command line was still necessary in w3.1)

i have jept that habit through the years, so when i moved from windoes to linux, my natural instincts of snake_case_folder_names made it so i didnt have to change : D

aaaaaaaaargh@feddit.org · 11 pts · 335d

That's not even DOS I think. As far as I know Win 95 came up with this monstrosity in an attempt to circumvent the 8.3 character limitations present in older versions of DOS.

wizardbeard@lemmy.dbzer0.com · 6 pts · 335d

One of the fun things about modern Windows is that ~1 shit still appears every once in a rare while. Gotta love just stacking more and more shit on top of ancient systems in the name of backwards compatibility!

db2@lemmy.world · 6 pts · 335d

I think you're misremembering a little. Long filenames was introduced in Win95.

Onomatopoeia@lemmy.cafe · 5 pts · 335d

Yea, Win 3.1 didn't support long names - that came with Win95. Win 3.1 was a shell on DOS.

But I understand - it all blends together after um... 40 years (ouch!).

toynbee@lemmy.world · 1 pts · 335d
lengau@midwest.social · 16 pts · 334d

I very intentionally have all my code in Personal Projects 🥰 and Work Projects 🏦 directories so I can find bugs in the handling of file paths.

BombOmOm@lemmy.world · 14 pts · 336d (1 reply)

I'm a big fan of PascalCase. ThisIsAGreatFilename.odt

RustyNova@lemmy.world · 3 pts · 336d

Rust made me have an habit of using snake_case... .rs

SnotFlickerman@lemmy.blahaj.zone · 14 pts · 336d (1 reply)

" is your friend

floquant@lemmy.dbzer0.com · 11 pts · 336d

Yep, exactly. And tab. \ is weird at first but makes sense if you think about it

ronigami@lemmy.world · 11 pts · 336d (7 replies)

If your code is written well, it shouldn’t matter.

Sonotsugipaa@lemmy.dbzer0.com · 19 pts · 335d (6 replies)

They're annoying to deal with when interactively using command-line shells, especially so when pasting unquoted and unescaped file paths, doubly especially so with Bash where parameter expansion makes no goddamn sense if you know at least one other programming language

ronigami@lemmy.world · 2 pts · 335d (5 replies)

Example of how parameter expansion matters?

Generally if you are pasting file paths there is a better way to do that. Use find with exec, or xargs, or a for loop. Or, get the list in Vim and escape (quote) every line at once. Unless you have double quotes in the filename too (which is actually a crazy thing) it shouldn’t be a big deal.

Sonotsugipaa@lemmy.dbzer0.com · 2 pts · 335d (4 replies)

Expansion matters because using parameters without quotes automatically splits words, and IIRC a quoted array parameter can still be split into its members — as opposed to Zsh, where word splitting doesn't happen unprompted and quoted array parameters are flattened into a single string.

Generally if I want to run $HOME/random executable with spaces.exe through Wine in a terminal I copy the path in Dolphin (CTRL+SHIFT+C, or CTRL+ALT+C idr) and paste it, within quotes if needed (the four extra key inputs are the annoying part).

I find that much faster than manually typing find "$HOME" -name "random executable with spaces.exe" -type x -exec wine "{}" \;, or opening an editor to insert backslashes.

ronigami@lemmy.world · 1 pts · 335d (3 replies)

Why on earth not just type wine ~/random and then hit tab to autocomplete? Or you could do

wine `echo random*`

AFAIK, if $file is a filename with spaces, then some_util ${file} will not split the filename.

Sonotsugipaa@lemmy.dbzer0.com · 3 pts · 335d (2 replies)

If the path to the dir is longer than $HOME, say, $HOME/Tools/modding/hd2-audio-modder/wwise/v123456789_idr_but_its_a_long_one/random file name with spaces, it makes more sense.

I'll try using the braces syntax, if it does prevent word splitting I wasn't aware of it, though it's still slightly inconvenient (3 key inputs for each brace on my kb) and I'd probably still use quotes instead if I had to use Bash and had the file path in a variable for some reason.

... though at this point I'm probably overthinking it, atm I don't recall better examples of my distaste for Bash expansion shenanigans.


Did some testing, here's what I found.
Beware, it devolves into a rant against Bash and has little to do with the original topic - I just needed to scream into the void a little.

# Zsh
function argn { echo $#; }

var='spaced string'
argn $var
# Prints 1: makes sense, no word splitting here

var=(array 'of strings')
argn $var
# Prints 2: makes sense, I'm using a 2-wide array where I would
#           want 2 arguments (the second one happens to have
#           a whitespace in it)
# Bash
function argn { echo $#; }

var='spaced string'
argn $var
# Prints 2: non-array variable gets split in 2 with this simple reference;
#           I hate it, but hey, it is what it is

argn ${var}
# Prints 2: no, braces do not prevent word splitting as I think you suggested

var=(array 'of strings')
argn $var
# Prints 1: ... what?

echo $var
# Prints array: ... what?!?
#               It implicitly takes the first element?
#               At least it doesn't word-split said first element, right?

var=('array of' strings)
argn $var
# Prints 2:


Upon further investigation:

# Bash
mkdir /tmp/bashtest ; cd /tmp/bashtest
touch 'file 1'
touch 'file 2'

stat file*
# Prints the expected output of 'stat' called on both files;
# no quotes or anything, globbing just expands into
# 2 arguments without *word* splitting

files=('file 1' 'file 2')
stat $files
# stat: cannot statx 'file'
# stat: cannot statx '1'
# WHY? WHY DOES GLOBBING ACT SENSIBLY WHEN ARRAYS DO NOT?

I get that the Bash equivalent to Zsh's $array is ${array[@]}, but making $array behave like it does in Bash has no advantage whatsoever.
... IS WHAT I WOULD SAY IF THAT WERE TRUE! YOU ALSO HAVE TO QUOTE "${array[@]}" BECAUSE WE LOVE QUOTES HERE AT BASH HQ!

# ... continued from before
stat "prefix ${files[@]}"
# stat: cannot statx 'prefix file 1'
# (regular 'stat' output for 'file 2')

While this behavior doesn't make much sense to me, it also doesn't make sense for me to write that "prefix" within the quotes in the first place, right?
YES. BECAUSE SPLITTING IS NOT WHAT YOU EXPECT WHEN YOU PUT STUFF IN QUOTES.

Sorry, I'll stop.

ronigami@lemmy.world · 3 pts · 335d (1 reply)

My bad, I was thinking of zsh. And I think it’s configurable there too so may not behave that way according to your settings. But it is at least the default on Mac.

Sonotsugipaa@lemmy.dbzer0.com · 2 pts · 335d

I use Zsh too, though at this point is becoming detrimental to my (already limited) Bash skills because of features like the ${^array}{1,2,3} syntax which I use in some scripts of mine, which in turn I wouldn't dare try to translate to Bash.

Lyra_Lycan@lemmy.blahaj.zone · 11 pts · 335d

Windows is stupid as shit, trying to shift+right click > open Powershell in a path containing a space results in it throwing an error, and you have to paste the path in yourself anyway

bob_lemon@feddit.org · 10 pts · 334d

My work has me working with Matlab Simulink paths, which may (and sometimes actually do) contain newlines.

jbk@discuss.tchncs.de · 8 pts · 335d (5 replies)

smells like skill issue tbh

tools which cant handle being installed/run on directories with spaces are so annoying

vivalapivo@lemmy.today · 8 pts · 335d

tools which cant handle being installed/run on directories with spaces are unacceptably common

nialv7@lemmy.world · 2 pts · 335d (3 replies)

You are clearly not a command line user :)

ulterno@programming.dev · 1 pts · 335d (2 replies)

I vaguely remember zsh in Manjaro (by default) having a tab completion that automatically added the slashes.
Never set it up myself though.

But I really hate having to worry about quoting my file variables in scripts.
So much, that after a certain complexity, I just give up the script and make the thing in C++.


Oh, and if I make a script that doesn't handle file names properly (because it's not required in that specific use case), I make sure to delete it after use, to prevent mistaken use later, which would otherwise cause more headache than just having to rewrite a script.

TarantulaFudge@startrek.website · 2 pts · 334d (1 reply)

You can just start the path with a quote and it will auto complete with spaces. I spend a lot of time correcting files with spaces replaced now. The spaces are better. I think music is the most annoying, since I like to use tools like EasyTag to extract metadata from filenames.

So please stop.naming_files.like_this.its_stupid

ulterno@programming.dev · 1 pts · 333d

You can just start the path with a quote and it will auto complete with spaces.

Oh, you're right. I just tried it out and it worked the same way.
I wonder what gave me the misconception the it doesn't by default.

lucg@lemmy.world · 8 pts · 335d (3 replies)

Now I'm imagining a shell that looks iteratively through arguments to find where quotes would make total sense

$ ls
my victims.ods
$ wipe -f my victims.ods --thorough

So the shell would go like

  1. wipe → command name found, ok
  2. -f → no file in the current directory starts with that, skip
  3. my → matches a file, keep in memory...
  4. my victims.ods → full match, but missing quotes!
  5. Prompt user:
Filename "my victims.ods" found without quotes. Choose:
[a]dd quotes this time
[A]lways add quotes (dangerous)
[n]o quotes today please
[N]ever offer adding quotes again
[t]ell me what could possibly go wrong when I choose to always add quotes
[P]unch the person who proposed this feature
BatmanAoD@programming.dev · 7 pts · 335d (2 replies)

For interactive use, tab-completion essentially makes this a non-issue, because shells add escaping in the appropriate places.

For scripting, where spaces are harder to deal with, unfortunately there's just not much you can do; your two options are basically to learn all of your particular shell's patterns for dealing with whitespace in filenames, or only write scripts in something other than a POSIX shell.

lucg@lemmy.world · 2 pts · 335d (1 reply)

Scripting isn't the issue, but for tab completion: the boundary is often at a space or parenthesis so that you need to type the backslash + char to continue tabbing to completion

BatmanAoD@programming.dev · 2 pts · 335d

Believe me, whitespace-correct scripting is absolutely an issue.

You're right that it's annoying when filenames diverge right at a character that must be escaped.

notarobot@lemmy.zip · 8 pts · 335d (4 replies)

Don't try svelte kit. This is pseudocode but it's valid. The only symbol show here that is not real is the / that I've placed at the end of folder to show that they are folders. There are other special cases

routes/
+page.ts
(admin)/
  +page.ts
  [user=uuid]/
    [[community]]/
      +page.ts
    posts/
      [...postIds@]/
        +page.ts
dogs0n@sh.itjust.works · 3 pts · 334d (3 replies)

sveltekit is beautiful (thanks for spreading the word)

notarobot@lemmy.zip · 3 pts · 334d (2 replies)

Im trying it out yet. It seems fun, the tutorial is amazing. I don't think I'd want to do large enterprise projects with it

dogs0n@sh.itjust.works · 2 pts · 334d (1 reply)

Have you noticed issues that you think would arrise at scale, etc for an enterprise project?

I'm using it for a small/medium sized project and it's great and has not got in the way once. Wondering how you feel, since I don't have experience with much enterprise code.

notarobot@lemmy.zip · 3 pts · 334d

Oh. No. You win. Mine is a gut feeling that modeling all routes with folders would become a paid. To navigate and manage, while you have actual experience

pineapplelover@lemmy.dbzer0.com · 6 pts · 334d (1 reply)

I still use spaces

rumba@lemmy.zip · 7 pts · 334d

agreed, "still worth it"

I do, however, tend to keep spaces out of my folder names so i can just use quotes at the end.

/Images/Halloween/Projections/"Creepy Crawlies.mp4"

BuboScandiacus@mander.xyz · 6 pts · 335d

“_” to the rescue

bitjunkie@lemmy.world · 5 pts · 335d

That's what backslash-tab is for

kieron115@startrek.website · 4 pts · 334d

at least you/arent/using\ linux

zerofk@lemmy.zip · 4 pts · 334d (1 reply)

Computers should just know when I want a space to be part of a file name, and when I want them to be argument separators. No more escaping or quoting.

Konstant@lemmy.world · -2 pts · 334d
[ removed ]
brown567@sh.itjust.works · 4 pts · 335d

whitespaceIsTheEnemy

Korne127@lemmy.world · 2 pts · 332d

Can't relate. I use shell all the time, and I always use spaces in file paths, especially to make sure scripts I make still work then

quantenzitrone@lemmings.world · 2 pts · 333d

i y'all just started using fish shell, you'd have proper shell completions and argument splitting that doesn't care about spaces in file names

falseWhite@lemmy.zip · 2 pts · 335d
[ removed ]
krunklom@lemmy.zip · 2 pts · 335d

Mv /home/"$USER"/Downloads /home/"$USER"/downloads

MonkderVierte@lemmy.zip · 1 pts · 335d
[ removed ]
sefra1@lemmy.zip · 1 pts · 334d

The number of keystrokes needed to type an underscore is the same that you need to type backslash space, so I don't see how underscores are in improvement

craftrabbit@lemmy.zip · 1 pts · 335d

I love emoji filenames

MehBlah@lemmy.world · 1 pts · 335d

End each word with a . Pretty simple. I just realized lemmy wont show a forward slash.

Jankatarch@lemmy.world · 1 pts · 334d

capital letters.

ILikeBoobies@lemmy.ca · 1 pts · 335d

SameHereBrother.