On 2010-10-15, Seebs <usenet-nos...@seebs.net> wrote: > On 2010-10-15, Grant Edwards <inva...@invalid.invalid> wrote: >> On 2010-10-15, Steven D'Aprano <st...@remove-this-cybersource.com.au> wrote: >>> In the Unix world, which includes OS X, text tools tend to have >>> difficulty with tabs. Or try naming a file with a newline or carriage >>> return in the file name, or a NULL byte. > >> How do you create a file with a name that contains a NULL byte? > > So far as I know, in canonical Unix, you don't -- the syscalls all work > with something like C strings under the hood, meaning that no matter what > path name you send, the first null byte actually terminates it.
Yes, all of the Unix syscalls use NULL-terminated path parameters (AKA "C strings"). What I don't know is whether the underlying filesystem code also uses NULL-terminated strings for filenames or if they have explicit lengths. If the latter, there might be some way to bypass the normal Unix syscalls and actually create a file with a NULL in its name -- a file that then couldn't be accessed via the normal Unix system calls. My _guess_ is that the underlying filesystem code in most all Unices also uses NULL-terminated strings, but I haven't looked yet. -- Grant Edwards grant.b.edwards Yow! What UNIVERSE is this, at please?? gmail.com -- http://mail.python.org/mailman/listinfo/python-list