From: Dominik Vogt <dominik.vogt@gmx.de>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: null bytes in file names?
Date: Mon, 7 Apr 2003 10:32:21 +0200 [thread overview]
Message-ID: <20030407083221.GD557@gmx.de> (raw)
As far as I know, UNIX file systems allow null bytes in file
names. Out of curiosity I tried generating such a file. I edited
a file fn in a hex editor and put a single null byte into it.
Take I (with "touch"):
$ touch $(< fn)
touch: creating `': No such file or directory
touch: creating `': No such file or directory
$ touch $(< fn)
touch: creating `': No such file or directory
$ touch s$(< fn)t
$ touch u"$(< fn)"v
$ ls
fn s t u
"u" might actually be named "u^@v" but displayed incorrectly by ls,
so let's try to access a file named "u".
$ ls u
u
Nope, the name got cut off.
$ rm s t y
Take II (shell builtins only):
$ echo foo > $(< fn)
zsh: no such file or directory:
$ echo foo > "$(< fn)"
zsh: no such file or directory: ^@
$ echo foo > w$(< fn)x
$ echo foo > y$(< fn)z
$ ls
fn w x y z
$ ls w y
w y
So, no luck. I wonder where the problem comes from:
- zsh? (4.0.4)
- libc?
- kernel? (linux-2.4.20)
Bye
Dominik ^_^ ^_^
next reply other threads:[~2003-04-07 8:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-07 8:32 Dominik Vogt [this message]
2003-04-07 8:48 ` Erik Trulsson
2003-04-07 9:40 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030407083221.GD557@gmx.de \
--to=dominik.vogt@gmx.de \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).