3 ms·
This reminds me that filenames can contain newlines.
by nikonyrh 4y ago
This reminds me that filenames can contain newlines.
- tomrod 4y agoD:
- guipsp 4y agoAnd nulls :)
- hddqsb 4y agoHow exactly can they contain nulls? fopen() takes a null-terminated filename, so if there is a null byte in the middle it would just truncate the filename.
- minusf 4y agothat might be a corrupt filename that can be opened only by its inode in debugfs or similar.
- teddyh 4y agoNo they can’t.
- 10000truths 4y agoThey can contain any octet except ASCII NUL and /. That said, pretty much every filesystem's on-disk format has an explicit length field for file names. So in theory, there's nothing stopping them from supporting completely binary filenames - it's the kernel's VFS layer that treats NUL and / as special.