←back to thread

356 points dgl | 4 comments | | HN request time: 0.977s | source
1. zahlman ◴[] No.44504059[source]
Suppose the system call to list a directory examined the place on the disk where a filename should be, and found bytes representing ASCII control characters. Should it deny the existence of the corresponding file? Assume disk corruption? Something else? After all, maybe (this is admittedly more theoretical than practical) those bytes map to something else in the current locale. It's not like modern Windows which assumes the filenames are all UTF-16.
replies(1): >>44509491 #
2. 0x457 ◴[] No.44504278[source]
Because filenames (and all other strings) are just bags of bytes on unix based systems.
replies(1): >>44504571 #
3. immibis ◴[] No.44509491[source]
What does it do today if there's a forward slash and a null byte?
replies(1): >>44511592 #
4. zahlman ◴[] No.44511592{3}[source]
Well for a null byte at least it would have just stopped reading at that point anyway.