Spaces in paths & filenames

Please compose all posts in Emacs.

Moderators: phlip, Moderators General, Prelates

Spaces in paths & filenames

Yes
19
50%
No
19
50%
 
Total votes: 38

User avatar
Copper Bezel
Posts: 2416
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Spaces in paths & filenames

Postby Copper Bezel » Sat Jun 24, 2017 3:10 am UTC

Just this. Had a bit of a tiff break out on Reddit recently in a thread about hyphens vs. underscores regarding which inferior substitute was superior instead of just using spaces between the words in the name of a file or folder. (Hyphens, obviously, but this is quite beside the point.)

I don't find it at all difficult to enclose paths in single quotes when I happen to be using CLI. I do like when my filesystem looks like names for things instead of weird and unsightly coding conventions. I do find it frustrating when a script or application manages to fail to correctly treat a path as a string and fails in case of spaces, but that's a problem with the script, not the convention.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

User avatar
ucim
Posts: 5643
Joined: Fri Sep 28, 2012 3:23 pm UTC
Location: The One True Thread

Re: Spaces in paths & filenames

Postby ucim » Sat Jun 24, 2017 3:41 am UTC

If it looks like the end of a token, it should be the end of a token.

Jose
Order of the Sillies, Honoris Causam - bestowed by charlie_grumbles on NP 859 * OTTscar winner: Wordsmith - bestowed by yappobiscuts and the OTT on NP 1832 * Ecclesiastical Calendar of the Order of the Holy Contradiction * Please help addams if you can. She needs all of us.

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 2550
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Spaces in paths & filenames

Postby Soupspoon » Sat Jun 24, 2017 6:16 am UTC

Spoiler:
By habit, I use "full quotes", not 'single ones', in DOS. So much so that I'd have to check the contextual differences. Not likely the same as *nix and/or Perl differences - it being DOS, probably entirely interchangeable with only after the "usebackq" FOR-option there being any differentiation between valid quote-characters, save perhaps that single-quotes can contain options with doubles in, without metaing, and verse vica...

But I'll also 'forget' a final quote in a line where I know the ambiguity will resolve.

Code: Select all

D:\SomeDirectory\AnotherDirectory> "c:\program files\foobar\foo" /bar "..\yet another place\bar.foo

...no need to close off the "yet another place" path with a quote, though there is (often - actually depends on how the ARGs get parsed, but best not to assume...) a need to open it.

Anyway...
MaybeBetterToUseCamelcase, but that does have potential for ambiguity, across systems. Intelligent use by a file/label author is necessary, and some people here still remember 8.3 limitations, I'm sure.

There was maybe confusion with jdbgmgr.exe and similar, but I'm reluctant to pad with either - or _ and I rarely use dashes without specific grammatical reasons, e.g. "magic-the gathering", "mgc-gthr", "Magic-theGathering" or other permutations, somewhere I'd use a dash to substitute for a colon (or colon space, or colon dashe [space]) because of the colon itself being more of a problem.

My ultimate decision wouldvbe based upon common sense (or the naïve impression of such), readability (ditto) and possibly an idea of what human/coded recipients of my decisions would have to deal with. I'm not sure I have a single preference, TBH..

User avatar
Flumble
Yes Man
Posts: 1951
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Spaces in paths & filenames

Postby Flumble » Sat Jun 24, 2017 8:01 am UTC

I often do not trust programs to correctly interpret paths/names with spaces, so I try to put all files that are to be used by a program in a spaceless path. Documents (spreadsheets and stuff) can go where ever.

User avatar
flicky1991
Like in Cinderella?
Posts: 632
Joined: Fri Feb 11, 2011 3:36 pm UTC
Location: London

Re: Spaces in paths & filenames

Postby flicky1991 » Sat Jun 24, 2017 8:03 am UTC

Flumble wrote:I often do not trust programs to correctly interpret paths/names with spaces, so I try to put all files that are to be used by a program in a spaceless path. Documents (spreadsheets and stuff) can go where ever.

That certainly sounds fair. Most of the time, though, I'm naming files that don't need to worry about that.
any pronouns (mainly she/he)
----
Avatar from ArguablyDerek
----
Discord for Forum Games posters
(Please let me know if the link doesn't work)
Spoiler:
Weeks wrote:
flicky1991 wrote:Maybe I am a female Justin Bieber!
Justine Bieber. Alternatively, Miley Cyrus.

User avatar
Copper Bezel
Posts: 2416
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: Spaces in paths & filenames

Postby Copper Bezel » Sat Jun 24, 2017 12:10 pm UTC

The situational dependency makes an awful lot of sense to me. I don't remember the exact details now, but I've definitely had cases in the past where I'd avoid using spaces within (or anywhere above, obviously) a particular directory where I'm using tools that might be confused by them.

If I can step back from the RW-style posturing intro post, I'm mostly just glad I'm not completely crazy for using spaces in paths at all. One could say that they were significantly less popular in that Reddit thread.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

User avatar
phlip
Restorer of Worlds
Posts: 7543
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Spaces in paths & filenames

Postby phlip » Sat Jun 24, 2017 1:41 pm UTC

The one thing I try to avoid is having the names of two files be the same except for something after a space... so like "foo" and "foo bar"... because now to access "foo bar" from the CLI using tab-completion, I type "f[tab]" and it gives me foo, and now I have to type a backslash and a space to diambiguate before pressing tab again will complete the rest of the filename.

The really annoying one is using Cygwin, and trying to get to Program Files (x86)... typing pro[tab] autocompletes "Program" (since there's also ProgramData sans space), have to type backslash-space-tab to autocomplete "Files", then backslash-space-tab again to autocomplete "(x86)". If they'd just named it "Program Data" with a space it could at least be just pro-tab-f-tab-backslash-space-tab, and shave off a keystroke.

It's petty, but it irritates me a little.

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

User avatar
Copper Bezel
Posts: 2416
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: Spaces in paths & filenames

Postby Copper Bezel » Sat Jun 24, 2017 1:47 pm UTC

I don't know if this is a Bash thing, but I notice that if I type a leading quote mark, tab completion can include spaces. It'll handily close the quote before the slash and I can keep drilling down from there.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

User avatar
phlip
Restorer of Worlds
Posts: 7543
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Spaces in paths & filenames

Postby phlip » Sat Jun 24, 2017 11:47 pm UTC

Yeah, but that would require me to think ahead, and type an opening quote mark before getting into this mess...

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

User avatar
Weeks
Hey Baby, wanna make a fortnight?
Posts: 1867
Joined: Sat Aug 23, 2008 12:41 am UTC
Location: Alien-lizard city, Panama

Re: Spaces in paths & filenames

Postby Weeks » Sun Jun 25, 2017 1:50 am UTC

Flumble wrote:I often do not trust programs to correctly interpret paths/names with spaces, so I try to put all files that are to be used by a program in a spaceless path. Documents (spreadsheets and stuff) can go where ever.
This. I am eternally paranoid. Though I'll use spaces if I'm feeling especially lazy and it's just a txt or screenshot that I'll keep on my desktop
Am I gregnant
suffer-cait wrote:One day I'm gun a go visit weeks and discover they're just a computer in a trashcan at an ice cream shop.
Kewangji wrote:I can solve nothing but I'd buy you chili ice cream if you were here, or some other incongruous sweet.

Nyktos
Posts: 138
Joined: Mon Mar 02, 2009 4:02 pm UTC

Re: Spaces in paths & filenames

Postby Nyktos » Sun Jun 25, 2017 3:41 am UTC

Flumble wrote:I often do not trust programs to correctly interpret paths/names with spaces, so I try to put all files that are to be used by a program in a spaceless path. Documents (spreadsheets and stuff) can go where ever.
What are you doing with those spreadsheets that doesn't involve them being used by any program?!

phlip wrote:The one thing I try to avoid is having the names of two files be the same except for something after a space... so like "foo" and "foo bar"... because now to access "foo bar" from the CLI using tab-completion, I type "f[tab]" and it gives me foo, and now I have to type a backslash and a space to diambiguate before pressing tab again will complete the rest of the filename.

The really annoying one is using Cygwin, and trying to get to Program Files (x86)... typing pro[tab] autocompletes "Program" (since there's also ProgramData sans space), have to type backslash-space-tab to autocomplete "Files", then backslash-space-tab again to autocomplete "(x86)". If they'd just named it "Program Data" with a space it could at least be just pro-tab-f-tab-backslash-space-tab, and shave off a keystroke.

It's petty, but it irritates me a little.
zsh handles this the way you'd want fwiw.

Demki
Posts: 194
Joined: Fri Nov 30, 2012 9:29 pm UTC

Re: Spaces in paths & filenames

Postby Demki » Sun Jun 25, 2017 3:52 am UTC

Funnily enough, Powershell handles tab-completion with files that have spaces in them just fine, it even automatically wraps the path in double quotes for you.
Powetshell is far from perfect, but at least you can easily type /pro[tab, perhaps more than once] to get "C:\Program Files (x86)\" with the cursor after the second \.

User avatar
Copper Bezel
Posts: 2416
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: Spaces in paths & filenames

Postby Copper Bezel » Sun Jun 25, 2017 4:16 am UTC

Hmm, anyone know a way to get that style of tab completion in Bash? (Or something similar to Bash?)

Edit: Not the spaces, the paging-through-possibilities-with-tab.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

User avatar
hotaru
Posts: 1025
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Spaces in paths & filenames

Postby hotaru » Sun Jun 25, 2017 4:36 am UTC

Copper Bezel wrote:Hmm, anyone know a way to get that style of tab completion in Bash? (Or something similar to Bash?)

use zsh?

Code: Select all

factorial product enumFromTo 1
isPrime n 
factorial (1) `mod== 1

User avatar
Copper Bezel
Posts: 2416
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: Spaces in paths & filenames

Postby Copper Bezel » Sun Jun 25, 2017 4:52 am UTC

Will do! Thanks! = ]

Edit: Oh HELL yes

Edit again, having actually got my .zshrc configured to something I can live with that includes Ctrl+Backspace: Oh HELLS YES
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

User avatar
Flumble
Yes Man
Posts: 1951
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Spaces in paths & filenames

Postby Flumble » Sun Jun 25, 2017 12:12 pm UTC

Nyktos wrote:
Flumble wrote:I often do not trust programs to correctly interpret paths/names with spaces, so I try to put all files that are to be used by a program in a spaceless path. Documents (spreadsheets and stuff) can go where ever.
What are you doing with those spreadsheets that doesn't involve them being used by any program?!

Shush, you know what I mean. :roll:
Some command line programs/scripts don't work nicely with spaces in their arguments.

Demki wrote:Funnily enough, Powershell handles tab-completion with files that have spaces in them just fine, it even automatically wraps the path in double quotes for you.

Indeed, even windows' classic command prompt has that behaviour.

Speaking of shells, I'd recommend fish over zsh for end-user stuff. blah blah blah not posix-compliant blah blah but it has rich completion out of the box. (zsh-completion-generator sounds great, but it'll have to hook into pacman for me to leave my local maximum).

User avatar
Copper Bezel
Posts: 2416
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: Spaces in paths & filenames

Postby Copper Bezel » Tue Jun 27, 2017 3:13 pm UTC

For whatever reason, I'm keeping zsh as my default login shell but have fish set as the default command for my terminal emulator (Tilix). It's ... really nice, with the suggestions and history and everything. I might have to actually start using some terminal apps.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 5534
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Spaces in paths & filenames

Postby Thesh » Tue Jun 27, 2017 3:27 pm UTC

The times I've had problems with spaces in paths almost exclusively result from scripts that pass input to the shell.
Honesty replaced by greed, they gave us the reason to fight and bleed
They try to torch our faith and hope, spit at our presence and detest our goals

User avatar
Xenomortis
Not actually a special flower.
Posts: 1397
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Spaces in paths & filenames

Postby Xenomortis » Tue Jun 27, 2017 4:04 pm UTC

spaces_should_be_abolished_and_we_should_all_type_like_this
Image

Derek
Posts: 2155
Joined: Wed Aug 18, 2010 4:15 am UTC

Re: Spaces in paths & filenames

Postby Derek » Tue Jun 27, 2017 9:58 pm UTC

We're not cavemen. If your program can't correctly handle paths with spaces, your program is bad.
Last edited by Derek on Wed Jun 28, 2017 10:31 pm UTC, edited 2 times in total.

User avatar
flicky1991
Like in Cinderella?
Posts: 632
Joined: Fri Feb 11, 2011 3:36 pm UTC
Location: London

Re: Spaces in paths & filenames

Postby flicky1991 » Tue Jun 27, 2017 10:01 pm UTC

you are program
any pronouns (mainly she/he)
----
Avatar from ArguablyDerek
----
Discord for Forum Games posters
(Please let me know if the link doesn't work)
Spoiler:
Weeks wrote:
flicky1991 wrote:Maybe I am a female Justin Bieber!
Justine Bieber. Alternatively, Miley Cyrus.

User avatar
Copper Bezel
Posts: 2416
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: Spaces in paths & filenames

Postby Copper Bezel » Wed Jun 28, 2017 12:26 am UTC

Got a point, though. If you are program can't handle spaces in paths, then you are program is bad.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 2550
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Spaces in paths & filenames

Postby Soupspoon » Wed Jun 28, 2017 1:06 am UTC

your right

:arrow:

User avatar
chridd
Has a vermicelli title
Posts: 779
Joined: Tue Aug 19, 2008 10:07 am UTC
Location: ...Earth, I guess?
Contact:

Re: Spaces in paths & filenames

Postby chridd » Thu Jun 29, 2017 3:16 am UTC

Soupspoon wrote:By habit, I use "full quotes", not 'single ones', in DOS. So much so that I'd have to check the contextual differences. Not likely the same as *nix and/or Perl differences - it being DOS, probably entirely interchangeable with only after the "usebackq" FOR-option there being any differentiation between valid quote-characters, save perhaps that single-quotes can contain options with doubles in, without metaing, and verse vica...
Does DOS/Windows allow single quotes at all? I seem to remember it only liking double quotes, and wine cmd says "File not found" when I try to use single quotes with dir and type.

For me, it depends on whether I intend to use the file from the command line (or open it in Vim, or reference it in an HTML or CSS file or some other sort of computer code). If so, I usually use all lower case and hyphens; otherwise, I'll sometimes use capital letters and spaces.
~ chri d. d. /tʃɹɪ.di.di/ (Phonotactics, schmphonotactics) · they (for now, at least) · Forum game scores
mittfh wrote:I wish this post was very quotable...
flicky1991 wrote:In both cases the quote is "I'm being quoted too much!"

EvanED
Posts: 4327
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Spaces in paths & filenames

Postby EvanED » Thu Jun 29, 2017 4:25 am UTC

chridd wrote:Does DOS/Windows allow single quotes at all? I seem to remember it only liking double quotes, and wine cmd says "File not found" when I try to use single quotes with dir and type.
Looks like Windows 7 cmd doesn't like single quotes, though I'm not sure if that extends to the C runtime (which parses command lines into argv[] for programs using a traditional C/C++ main function), and I don't have an easy way to test that quickly. So it may be the case that programs that aren't built into cmd will tend to work correctly. I do have one data point, which is that I can run winword "file with spaces.docx" and it opens, but if I use single quotes, it doesn't work and splits it at spaces. So if that's using the usual crt, it doesn't like single quotes.

PowerShell though accepts single quotes.

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 2550
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Spaces in paths & filenames

Postby Soupspoon » Thu Jun 29, 2017 6:51 am UTC

chridd wrote:Does DOS/Windows allow single quotes at all? I seem to remember it only liking double quotes, and wine cmd says "File not found" when I try to use single quotes with dir and type.
After I wrote that, I tested as soon as I got back to the first Windows machine (XP) and discovered much as you say.

Except, for some reason, the strange behaviour of the (usefully expanded) FOR options. Without "usebackq" option the (string) part is the traditional file-list, ("string") is a literal string (except likely with variable substitution) and ('string') is a command to interpolate (at last! ...so much useful stuff could now be done, previously only in *nix shell-scripts). But with "usebackq", it's now ('string') and (`command`), instead. And I've no idea why. It's like that in W2K too (checked that later) and I've yet to check any (named) NT version of Windows to see where the need for two different legacy schemes might have merged from. It's not as if the backquote version of FOR looks anything like the non-DOS shell counterparts, to be so confusable...

I can only imagine it's a sop to those with alternate national keyboards. Maybe «»-quotes as default, etc?

Never mind, though.

speising
Posts: 2080
Joined: Mon Sep 03, 2012 4:54 pm UTC
Location: wien

Re: Spaces in paths & filenames

Postby speising » Thu Jun 29, 2017 8:40 am UTC

Unintuitively, usebackq is most useful to remove the specialness of double quotes, so you can have them inside 'a "string" literal'.

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 2550
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Spaces in paths & filenames

Postby Soupspoon » Thu Jun 29, 2017 11:05 am UTC

I should have thought of that. For some reason (maybe stemming from my reading the whole "FOR /?" documentation and thus being aware of all possible options, as soon as I found out it was so much more expanded from what it had been previously) I've always used "usebackq" when doing anything remotely complicated with new-FOR, and thus had to reinterpret the escaping of various quotes in reverse when my version of the approach caused occasional 'meta'ing problems. ;)

Demki
Posts: 194
Joined: Fri Nov 30, 2012 9:29 pm UTC

Re: Spaces in paths & filenames

Postby Demki » Thu Jun 29, 2017 11:13 am UTC

chridd wrote:Does DOS/Windows allow single quotes at all? I seem to remember it only liking double quotes, and wine cmd says "File not found" when I try to use single quotes with dir and type.

Testing on a windows 10 machine:
cmd.exe doesn't accept 'single quotes', only "double quotes".
powershell accepts both, with 'single quotes' representing a verbatim string, and "double quotes" allows you input special characters with a backtick(like `n for new line).
Basically, if you are using windows, either use powershell or download some other shell. (There is the project of getting ubuntu running on windows called windows subsystem for linux)

User avatar
Copper Bezel
Posts: 2416
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: Spaces in paths & filenames

Postby Copper Bezel » Thu Jun 29, 2017 12:12 pm UTC

I haven't tried it (not on Windows enough) but I've heard the system, despite being a full and real Ubuntu system running on top of NT + WSL instead of Linux, is limited in terms of what it can do back to the Windows system. There's Fedora and openSUSE coming as well, though.

One thing I don't like much about fish is that there's no way to enable Ctrl+Backspace for ^W. I bound Alt+Backspace but a decade and a half of muscle memory and the way I use the keyboard in every other app are not going to rebind so quickly. Not quite enough to make me stick to Z Shell, though, as fish's suggestion feature goes beyond tab completion into possible divinity.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

User avatar
trpmb6
Posts: 272
Joined: Tue Jul 09, 2013 6:27 pm UTC

Re: Spaces in paths & filenames

Postby trpmb6 » Tue Jul 18, 2017 4:24 pm UTC

I almost exclusively use underscores in all file structures and file names because of my time working with a major aircraft manufacture (will remain nameless) that was (until quite recently) very reluctant to allow any changes to their various programs (usually due to aircraft certification and backwards compatibility issues). Suffice to say, some of their programs did not like spaces. Some did. In some cases you would have files used by multiple programs where it would sometimes work, sometimes not. Extremely frustrating when you are a new engineer and never used any of the programs and keep getting errors for an input file that worked just fine elsewhere. Then you ask around and its a simple "oh, remove the spaces from filenames of your input files."

Its been a long time since I've worked for that OEM but I still put underscores on EVERYTHING i use. Even the file structures for all the pictures of my kids. At this point it's kind of an OCD obsession of mine.

User avatar
hotaru
Posts: 1025
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Spaces in paths & filenames

Postby hotaru » Tue Jul 18, 2017 8:11 pm UTC

*is definitely not writing whatever the opposite of malware is to change all underscores in paths and filenames to spaces*

Code: Select all

factorial product enumFromTo 1
isPrime n 
factorial (1) `mod== 1

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 2550
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Spaces in paths & filenames

Postby Soupspoon » Tue Jul 18, 2017 11:11 pm UTC

From bitter experience, I know that running defrag from DOS 6.22 (or earlier) on LFN-supporting FAT areas like a Win95 (or later) does a brilliant job of reducing trivial and inconsequential directory names such as "Program Files" to the handier "PROGRA~1", and likely a whole set of "MICROS~1","MICROS~2", "MICROS~3", directories beneath it...

That was a fun problem to resolve (especially when one hadva hard time finding another Win95 user, at the time, to get a 'DIR /S /someotheroptionsIforget | FIND "~" > file' copied to floppy to aid in the subsequent manual repair...). Everyone shouod try it.

User avatar
hotaru
Posts: 1025
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Spaces in paths & filenames

Postby hotaru » Tue Jul 18, 2017 11:36 pm UTC

Soupspoon wrote:From bitter experience, I know that running defrag from DOS 6.22 (or earlier) on LFN-supporting FAT areas like a Win95 (or later) does a brilliant job of reducing trivial and inconsequential directory names such as "Program Files" to the handier "PROGRA~1", and likely a whole set of "MICROS~1","MICROS~2", "MICROS~3", directories beneath it...

That was a fun problem to resolve (especially when one hadva hard time finding another Win95 user, at the time, to get a 'DIR /S /someotheroptionsIforget | FIND "~" > file' copied to floppy to aid in the subsequent manual repair...). Everyone shouod try it.

back in those days, that shouldn't have been too much of an issue. reinstalling windows regularly was already necessary for most people, so there was an obvious easy solution.

Code: Select all

factorial product enumFromTo 1
isPrime n 
factorial (1) `mod== 1

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 2550
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: Spaces in paths & filenames

Postby Soupspoon » Wed Jul 19, 2017 12:24 am UTC

It was my own machine, my first experience of post 3.x Windows, with no way of knowing how the reinstall would work (it had been pre-installed by the company I'd bought it from, something I'd avoid in a PC, these days) and still somewhat a mystery to me. Hence the silly error. I had no fall-back, and no easy method to backup of everything the reinstall would have (seemingly) wiped. No easy copying to USB (pkzip spannng onto countless HD floppies was probably my nearest option to that). But I knew that if I got a tree listing of some kind that I could return all the tilde names to original LFN ones.

(Although that install of Windows had tilde SFNs now scattered around the registry, where it had automatically gone "Can't find 'Long Name With Spaces In'... Change the reference to this similar-looking 'LONGNA~1'!" during that first, fateful bootup after my mistake, when everything had started failing and warning...)


Basically, I was a bit of a n00b with Win95 (as indeed was everybody, in that particular month in 1995!). My prior decade of DOS experience was no use. In fact was behind my 'smart' idea to use the older defrag when I hadn't been convinced that the Windows one was actually doing the job I thought it should...


(A couple of months later, though, I totally aced a job interview after being asked if I knew how to create a shortcut on the desktop, and I listed at least a half dozen different alternative methods straight off the top of my head. I think I stunned them. I got that job, and it turned into one of the best jobs I ever had. Though that might have been just been coincidence, and/or luck)

User avatar
trpmb6
Posts: 272
Joined: Tue Jul 09, 2013 6:27 pm UTC

Re: Spaces in paths & filenames

Postby trpmb6 » Wed Jul 19, 2017 5:50 pm UTC

Soupspoon wrote:From bitter experience, I know that running defrag from DOS 6.22 (or earlier) on LFN-supporting FAT areas like a Win95 (or later) does a brilliant job of reducing trivial and inconsequential directory names such as "Program Files" to the handier "PROGRA~1", and likely a whole set of "MICROS~1","MICROS~2", "MICROS~3", directories beneath it...

That was a fun problem to resolve (especially when one hadva hard time finding another Win95 user, at the time, to get a 'DIR /S /someotheroptionsIforget | FIND "~" > file' copied to floppy to aid in the subsequent manual repair...). Everyone shouod try it.



UGH I too remember having to deal with this.

User avatar
trpmb6
Posts: 272
Joined: Tue Jul 09, 2013 6:27 pm UTC

Re: Spaces in paths & filenames

Postby trpmb6 » Wed Jul 19, 2017 5:53 pm UTC

Soupspoon wrote:(A couple of months later, though, I totally aced a job interview after being asked if I knew how to create a shortcut on the desktop, and I listed at least a half dozen different alternative methods straight off the top of my head. I think I stunned them. I got that job, and it turned into one of the best jobs I ever had. Though that might have been just been coincidence, and/or luck)



Lol, look how far we have come since then. Just imagine being asked that question in an interview today. The look on your face would probably be priceless.

shieldforyoureyes
Posts: 339
Joined: Sat Apr 19, 2008 9:00 am UTC
Contact:

Re: Spaces in paths & filenames

Postby shieldforyoureyes » Sat Sep 30, 2017 4:24 pm UTC

Copper Bezel wrote:I don't know if this is a Bash thing, but I notice that if I type a leading quote mark, tab completion can include spaces. It'll handily close the quote before the slash and I can keep drilling down from there.


That's from the GNU readline library, which bash uses.

Mutex
Posts: 1068
Joined: Wed Jan 09, 2008 10:32 pm UTC

Re: Spaces in paths & filenames

Postby Mutex » Sat Sep 30, 2017 5:54 pm UTC

Related to this, I made a fun discovery recently that both Windows and Linux will allow you to make a file with nothing but spaces in its name. And you can have multiple files in the same directory whose names are just different numbers of spaces. You need to use the -Q flag with ls to see the names properly:

Code: Select all

$ ls -1Q
" "
"  "
"   "


Otherwise you just get:

Code: Select all

$ ls -1
 
 
   

In Windows, you need to do this through a terminal emulator (Git Bash worked for me), Windows Explorer won't allow you to create them, and actually throws an error if you try deleting them! So, fun prank potential there obviously. The Linux file manager I tried allowed both creation and deletion.

User avatar
chridd
Has a vermicelli title
Posts: 779
Joined: Tue Aug 19, 2008 10:07 am UTC
Location: ...Earth, I guess?
Contact:

Re: Spaces in paths & filenames

Postby chridd » Sun Oct 01, 2017 4:54 am UTC

Mutex wrote:Related to this, I made a fun discovery recently that both Windows and Linux will allow you to make a file with nothing but spaces in its name.
A long time ago, when I was using the original (non-Unixy) Mac OS and was much younger, my organization strategy involved when a folder was getting too full, leaving everything where it was and creating a subfolder called " " with all the files created after that point (so this folder would be at the top of the list). I also heavily used spaces at the beginnings of file names for a similar purpose (everything's important enough that it should go at the top of the list!); also a few folders starting with ~ so they'd go at the end. I don't remember any programs having an issue with this.
~ chri d. d. /tʃɹɪ.di.di/ (Phonotactics, schmphonotactics) · they (for now, at least) · Forum game scores
mittfh wrote:I wish this post was very quotable...
flicky1991 wrote:In both cases the quote is "I'm being quoted too much!"


Return to “Religious Wars”

Who is online

Users browsing this forum: No registered users and 3 guests