Specifying file paths
Specifying file paths
![](https://lemdro.id/pictrs/image/5f6e0281-313b-45b6-ac0a-369b47f75089.png?format=webp&thumbnail=128)
![](https://lemdro.id/pictrs/image/5f6e0281-313b-45b6-ac0a-369b47f75089.png?format=webp)
Specifying file paths
Why fight when you can just do cd /mnt/c/Program\ Files\ \(x86\)/
Ohhhhh... I fucking hate this. I use Windows locally, but I do support for a render farm that runs on Linux. The number of times I have recieved "it works locally" tickets from an artist who decided to get clever and embed Windows paths in string literals in their scene makes me want to punch a puppy. They don't even look at the application logs we provide to see that the paths threw errors. We handle repointing their file paths with symlinks normally, but when they use literals it literally fucks the system with escapes. I will never understand why Microsoft refuses to standardize to POSIX with the rest of the world. Aside from them being a US company with decision makers who still think freedom units make sense.
This meme is way more clever than it should be
Didn't realize until I read your comment. Thanks.
Took me a minute
Can you please explain? I've never used Mac and it's been a long time since I've properly used windows.
When you migrate the filesystem from a windows to Linux installation and hours later you can't find anything
I hate that I need to use escape characters when creating something for windows.
Python raw strings to the rescue!
Pathlib is the answer.
Try pathlib. All your problems solved.
Fun fact, though: Linux is the only case-sensitive one.
Edit: I feel silly for forgetting that it's all about the choice of FS. If anyone needs anything from me, I'll be in the corner, coloring.
From a technical standpoint, the windows NTFS filesystem is designed inherently case sensitive, just windows doesn't allow creating case sensitive files.
Connecting an NTFS drive to linux, you can create two separate files readme.txt and Readme.txt.
Using windows, you can see both files in the filesystem, but chances are most (if not all) software will struggle accessing both files, opening readme.txt might instead open Readme.txt or vice versa.
For a few years now, Windows has had the capability of marking certain directories as case-sensitive. So you can have a mixed-case-sensitivity filesystem experience now. Yeah. :/
You're correct. I once was trying to rename a file in Windows in a git repository that had a wrong capitalization. It was tricky.
I once ran into a bug in an Arduino program where it wouldn't compile. The author blamed my "broken environment". Turned out, he had included "arduino.h" instead of the correct "Arduino.h".
Although you can use case insensitive filesystems with Linux, and case sensitive filesystems with macOS. I believe the case sensitivity is a function of the specific filesystem --- but yeah, practically, the root for Linux is always case sensitive, and APFS ain't is only if you ask it to be ( https://support.apple.com/lv-lv/guide/disk-utility/dsku19ed921c/mac ).
As is right and proper.
But why? What is the point?
That you can give 2 different files the same name? Because that would confuse the hell out of every regular user. Especially if you work on a network share and have an entire directory full of same named files because everyone and their grandma throws their files in there.
It is almost as bad as Case Sensitive Usernames and email.
Least favorite part of linux honestly
Hard disagree. I don't understand why anyone would want case insensitive.
Am I the only one who doesn't go around mindlessly capitalizing letters? Do people find it too difficult to capitalize things?
Do you want case insensitive passwords too?
If I type X I mean X and only X. Uppercase letters are different letters, just like X and Y are different letters.
You can turn it off, at least for ext4: https://lwn.net/Articles/784041/
On MacOS you get a choice when you format the drive.
Would it be more efficient to say Unix vs Windows?
You mean right vs. wrong?
Posix
I'd just like to interject for a moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.
Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.
There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!
\o/
You can actually use / as a path separator on Windows in functions like fopen(), because it supports some ancient version of POSIX standard.
There used to be an undocumented setting in early versions of MS-DOS that would allow the setting of the command option character to something other than the slash, and if you did that, the slash automatically became the path separator. All you needed was SWITCHAR=-
in your CONFIG.SYS and DOS was suddenly very Unix-y.
It was taken out after a while because, with the feature being undocumented, too many people didn't know about it and bits of software - especially batch files, would have been reliant on things being "wrong". The modern support for regular slash in API calls probably doesn't use any of the old SWITCHAR code, but it is, in some way, the spiritual descendant of that secret feature.
Here's an old blog that talks about it: https://learn.microsoft.com/en-gb/archive/blogs/larryosterman/why-is-the-dos-path-character
The one thing about NT was that it didn't have it's own semantics, but it could emulate any system you wanted. It's the unofficial successor of an OS that was based on creating VMs where you could run any other OS you want.
Then Microsoft decided to create their own system in it, and only really finished writing that one.
File systems aren't even real.
What is this "real" concept anyway?
Adam Savage famously stated on Mythbusters "I reject your reality and substitute my own"
Sure, but is reality even real then? Is anything real?
Not that I meant to get all pop-philosophical on this beautiful Sunday morning, sorry about that.
I, too, first heard this quote from Adam on Mythbusters as a child. But, I'm pretty sure I also heard it was said first by some philosopher.
I would later be informed that "some philosopher" was the 1984 film The Dungeon Master.
Only apparently that was not the first, and it was said in a 1974 episode of Doctor Who. Well, someone on Reddit said that, and linked to this WikiQuote page but on that page it also says it's from The Dungeon master.
So, I don't know what to believe any more, and I still hope it was actually an obscure lost quote of Rene Magritte or something because in my head it would just make sense.
Yes
Interpretation of reality is individual
Reality itself is relative
But if it didn't exist we wouldn't be chatting about it right now
That's my reality anyway
What's yours?
at that point operating systems are also not real.
Duel of the fates: \//\
Also the internet belongs on the left.
And really, Linux/macos could be reduced to "Unix" https://upload.wikimedia.org/wikipedia/commons/7/77/Unix_history-simple.svg
And BSD. It's really just Windows vs. literally everything. Or is there anything else that uses backslashes?
CP/M
Which in this context is named hilariously.
Typical windows behavior
Also the internet belongs on the left
This rings true in more ways than one.
Only Mac OS 10 and later, based on BSD, uses ‘/‘. (And, I guess, A/UX.) Classic MacOS used a ‘:’, but it wasn’t regularly exposed in the UI. The only way most users would know is that the colon couldn’t be used in a file name.
I might be wrong, but I think you still can't use a ':' in a filename in macOS. If I recall correctly it will let you do it and show it in Finder, but actually replace it with a '-'.
I mean literally… example.com**/**index.html
I don't really watch Star Wars. I'm a more of a Trekkie gal.
🖖
See, you can separate files both ways as long as it's logical
Specifying paths with - would be its own special brand of hell.
I don't get it
Linux uses forward slash. Windows uses backslash. Because some dude 45 years ago wanted to make it look different from UNIX.
The lightsaber direction is like / \
A whole fight in characters:
/
X
| |
/
Both works fine in Windows tho?
Used to not
In Linux it is still not.
Actually, from what I can tell in my brief 15-minute internet search, every version of Windows since NT has accepted both because DOS 2.0 supported both. The exception to this was Command Prompt. But, these days, it supports both. Not sure when they made that change in Command Prompt, but I think it's been that way since at least Windows 7.
The number of times I had to ask "how can I tell where the file 'physically'" (I know) "lives" on the network when I took up work at a Windows shop, it was just baffling. And Win people couldn't understand what I was asking.
There's a location for this effing thing. I want to know where it is, really! How do I get that info?!
It's not Win people. It is dumb people.
Any Infrastructure IT guy can tell you where specific files are stored, it is their job. Whether they mainly use Windows, Mac or Linux doesn't matter.
Physically, it's probably on your hdd or ssd. Or possibly just in ram or a data center somewhere 😜
If you know what a nordic keyboard layout looks like, you'd probably prefer backslash. Since I moved to Linux a year ago I've been struggling to find the easiest way to forward slash. Shift + 7? Or numpad / with my right pinky?
Shift + 7? Or numpad / with my right pinky?
Yes.
For me it's even worse. Forward slash is also Shift + 7 and backslash is AltGr + ß?? I hate that computing is only optimized for US american layouts. Going by my keyboard, the filepath separator should probably be an ö.
The alt gr + ß is probably the same for nordic keyboards, the one below A. It's <>\ for me, but afaik both < and > are also individual keys on a US keyboard. And then there's ~. But I guess you get used to dead keys.
Had a similar struggle with the German layout, but in the meantime I have moved to the "EURKey" layout. It is built in to many distros and available for Windows and Mac. It mimics a US layout while still having all the äüöß (and much more) I could ever need. Though I will say it's only really worth it if you're in IT or similar where you frequently need certain symbols.
That's not a bad shout at all. It does hide æøå on weird keys though, would take a lot of practice to get used to that, but I'll definitely put that layout into the layout rotation, thanks for the suggestion.
EURKey
Pressing ó
is far less intuitive than ´
+ o
... hard pass.
Get a macro pad and configure one button to type a forward slash.
How do you type URLs using that keyboard layout?
Shift+7 feels wrong for some reason, so I currently tend to just send my pinky on a kamikaze mission towards the numpad hoping I hit /. Sometimes I hit numlock, sometimes I hit *.
Even if I made a compose key "shortcut" via ~/.XCompose it'd still be more work than what I'm doing already.
Macro pad could be a solution, I have considered it beforehand for other purposes tbh
Shouldn’t the blade be green? I thought Luke wore all black in ROTJ when he got hos green lightsaber.
I love linux like a pet. I love windows like my car. Can we stop with this pointless making a content mountain over any insignificant difference. Don't get me started
Linux is my car and pet at the same time. Does that make it a carpet?
I just begun hearing "I'm in the house like carpet" inside my head. Thanks Tobyfox on Bluesky!
Look again