Yup. And I firmly hold that programs should use them. It avoids separate code for Linux vs windows and inevitable bugs. It's also necessary for paths in URIs.
It might look a little weird at first, but they're well supported. I can't comment on what command line tools could have issues with them, as I stick to WSL for any windows shell usage.
Bonus: escaping has been broken in PowerShell for years. For example, if you have a file name with square brackets in it:
# works
> ls -literalpath "[foo].txt"
# silently fails
> ls "[foo].txt"
# silently fails
> ls "`[foo`].txt"
# file not found error
> ls "``[foo``].txt"
# file not found error
> ls "```[foo```].txt"
# works
> ls "````[foo````].txt"
# works
> ls "`````[foo`````].txt"
# file not found error
> ls "``````[foo``````].txt"
From what I understand, the problem is that PS and the individual cmdlets can perform several rounds of unescaping and expansion and the exact number of rounds depends on the cmdlet.
E: With the same file name, Get-Content (cat) works with 2-5 levels of escaping and throws file not found otherwise. Select-String (grep) silently fails with 0 or 1 levels, works with 2-5, raises an error with 6-7, silently fails with 8-9, etc.
If the fault happens in userspace code (i.e. not in the kernel itself), most operating systems send a signal (exception) to the process, which the process might choose to handle, or if unhandled will usually just kill the process.
If it happens in kernel space, unless it was intentional because the kernel was testing the capabilities of the processor, the system will probably crash (with a kernel panic / BSOD / etc.).
Basically it starts shrieking in pain and rage through your speakers, as thousands of hungry undead rats empty out of your PC screen to devour your flesh.
It’s really OS-dependent. Invalid opcodes by convention trigger a 0x6 hardware fault, which the OS will have to handle like any other hardware fault. In most cases, you’ll just get hit with some kernel crash screen, but in theory the fault could be handled!
but the kernel doesn't crash, e. g. on Linux you get a SIGILL signal which you can catch (a lot of stuff uses this to probe for what kind of optimized paths they can use, for example openssl).
They will if you tell them to. They also might if they encounter some kind of undefined behavior. There are many many compilers for many many languages and platforms. They aren't perfect and have their own suite of flaws.
This could happen. There are "compilers" for interpreted languages that work by bundling the interpreter as the start of the exe, and then putting the source code of everything (including libraries) later in the same file. It's handy for distributing apps to non-developer users.
Usually, those bundlers will do a cursory syntax check on the source, so this sort of error is unlikely to happen unless that was bypassed, or someone manually edited the source in the exe.
you could also name your code with .exe and compile it, I mean you could name it code.poopybutt if you wanted. extensions are really just a courtesy (though lots of Windows apps tend to care about them more)
Jesus...maybe find out for yourself dude? But basically it’s about the world betterment projects of Bill and Melinda Gates post-Microsoft interspersed with tales of his life growing up, his relationship with his family and friends, and his career through Microsoft. The general theme is that wealth can’t buy him time and he’s still up against forces outside of his control. “What is your greatest fear?” “I don’t want my brain to stop working.”
229
u/brendan_orr Oct 05 '19
Unix-style directory delimiters with a Windows path.
342
u/DerpFalcon12 Oct 05 '19
gotta love it when your already compiled executable has a syntax error
89
u/nerdz0r Oct 05 '19
When your INF file is also an .EXE
21
u/[deleted] Oct 05 '19
False. It’s not a Unix system.
32
u/Lneux Oct 05 '19
I'm sorry Bill, I'm afraid I can't let you do that.
26
u/Sarenord Oct 05 '19
I mean you can wrap a batch script into an exe, it's not impossible but the error would show up in different form.
The path is unforgivable though
9
u/frezik Oct 05 '19
This could happen. There are "compilers" for interpreted languages that work by bundling the interpreter as the start of the exe, and then putting the source code of everything (including libraries) later in the same file. It's handy for distributing apps to non-developer users.
Usually, those bundlers will do a cursory syntax check on the source, so this sort of error is unlikely to happen unless that was bypassed, or someone manually edited the source in the exe.
6
u/EreseaSiden Oct 05 '19
00011010111010102 Syntax error
11
u/HarpersGeekly Oct 05 '19
If you haven’t seen that doc/miniseries it’s definitely worth a watch. I loved it.
9
u/allinthegamingchair Oct 05 '19
Well, it ain’t the worst Hollywood has tried, at least a syntax error is an error that can happen (not to executables obv)
4
u/[deleted] Oct 06 '19
“INF file SETUP.exe” Makes perfect sense.
2
u/SpaceChez Oct 06 '19
Wait this is clearly the programs fault, why should I contact my system administrator?
1
u/k20stitch_tv Oct 06 '19
But how did it compile
1
u/Chromium_Fuyaki Oct 15 '19
Why did I read that as "Little Bill's Brain"
0
u/manutd105 Oct 06 '19
“Ok”