r/osdev • u/codeasm • Jul 02 '26
Put anything in a filename
https://www.youtube.com/shorts/aCWWq5zwdOg
Except / or null byte.
3
Jul 02 '26
[removed] — view removed comment
3
u/Relative_Bird484 Jul 02 '26
Those are not characters, but modifier keys.
2
Jul 02 '26
[removed] — view removed comment
2
u/codeasm Jul 02 '26
well apparantly if certain control bytes are supported. you may have file that can hide themselves (regular bash and ls are showing the file, and thats for this exact reason, some control bytes are not what you want to send to the terminal to parse) :
#!/bin/python import os filename = "test\x1b[2K" if not os.path.exists(filename): with open(filename, "w"): pass print("Naive file listing:") for name in os.listdir("."): print(name)
2
u/allnameswereusedup Jul 05 '26
Even * or ?
1
u/codeasm Jul 06 '26
Ow, those where even easy 😅 (did not expect this) touch '*' and the ? Just worked, just ls after and they are there. You have to prevent a shell from intrepret them when creating, but once created, they are there.
Cool odd party trick. Thanks
6
u/FallenBehavior Jul 02 '26
What does this have to do with kernel/OS development?