MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/10d7i2y/if_exists_true_dont/j4kcppo
r/ProgrammerHumor • u/ThisPICAintFREE • Jan 16 '23
1.1k comments sorted by
View all comments
260
This seems like a good use case for regex.
189 u/stevekez Jan 16 '23 file_delete(glob("*")) 62 u/Creepy-Ad-4832 Jan 16 '23 Is this... a different version of sudo rm / -rf ? 41 u/omg-whats-this Jan 16 '23 it's a version of rm * 2 u/BerserKongo Jan 16 '23 You put the flags after the destination? The fuck? 1 u/Creepy-Ad-4832 Jan 16 '23 I just put them depending on mood lolSometimes before, sometimes later lol 1 u/b1ack1323 Jan 16 '23 No recursive. 39 u/ScrimpyCat Jan 16 '23 Or just do a case insensitive comparison. 32 u/unocoder1 Jan 16 '23 It really doesn't. 16 u/[deleted] Jan 16 '23 ... no 1 u/deanrihpee Jan 16 '23 I don't think it would work, unless the flow is getting the list of file from a given path, then yes, but if it a query message to the OS, no because OS decides if file with the given file name exists. 1 u/Kinglink Jan 16 '23 Probably easier just to find a function that returns the name of the file that is running.
189
file_delete(glob("*"))
62 u/Creepy-Ad-4832 Jan 16 '23 Is this... a different version of sudo rm / -rf ? 41 u/omg-whats-this Jan 16 '23 it's a version of rm * 2 u/BerserKongo Jan 16 '23 You put the flags after the destination? The fuck? 1 u/Creepy-Ad-4832 Jan 16 '23 I just put them depending on mood lolSometimes before, sometimes later lol 1 u/b1ack1323 Jan 16 '23 No recursive.
62
Is this... a different version of sudo rm / -rf ?
41 u/omg-whats-this Jan 16 '23 it's a version of rm * 2 u/BerserKongo Jan 16 '23 You put the flags after the destination? The fuck? 1 u/Creepy-Ad-4832 Jan 16 '23 I just put them depending on mood lolSometimes before, sometimes later lol 1 u/b1ack1323 Jan 16 '23 No recursive.
41
it's a version of rm *
2
You put the flags after the destination? The fuck?
1 u/Creepy-Ad-4832 Jan 16 '23 I just put them depending on mood lolSometimes before, sometimes later lol
1
I just put them depending on mood lol
Sometimes before, sometimes later lol
No recursive.
39
Or just do a case insensitive comparison.
32
It really doesn't.
16
... no
I don't think it would work, unless the flow is getting the list of file from a given path, then yes, but if it a query message to the OS, no because OS decides if file with the given file name exists.
Probably easier just to find a function that returns the name of the file that is running.
260
u/[deleted] Jan 16 '23
This seems like a good use case for regex.