[SLE] File naming puzzle
Here's a little puzzle pertaining to filenames. If I type cat > one-two one ^D cat one-two I will, of course, see `one' displayed. But suppose the file is named one/two, not one-two. (And no, I really don't want a `two' file within a `one' directory.) How can I repeat this ceremony? Or can I? Paul Abrahams -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
"Paul W. Abrahams" wrote:
Here's a little puzzle pertaining to filenames.
If I type
cat > one-two one ^D cat one-two
I will, of course, see `one' displayed. But suppose the file is named one/two, not one-two. (And no, I really don't want a `two' file within a `one' directory.) How can I repeat this ceremony? Or can I?
I don't think this is possible. Even escaping it doesn't work. This is probably to avoid confusion and ambiguity in filenames. I tried looking in the kernel docs for confirmation, but couldn't see anything related to ext2, so unless I was to go poking around the source, I couldn't say for sure. Of course, if anyone else has got this to work, I would be interested in hearing about it as well... Chris -- __ _ -o)/ / (_)__ __ ____ __ Chris Reeves /\\ /__/ / _ \/ // /\ \/ / ICQ# 22219005 _\_v __/_/_//_/\_,_/ /_/\_\ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Hi, On Thu, Mar 09 2000 at 10:51 -0500, Paul W. Abrahams wrote:
Here's a little puzzle pertaining to filenames.
If I type
cat > one-two one ^D cat one-two
I will, of course, see `one' displayed. But suppose the file is named one/two, not one-two. (And no, I really don't want a `two' file within a `one' directory.) How can I repeat this ceremony? Or can I?
You can't create a file with slashes in it's name. Quote from W. Richard Stevens' "Advanced Programming in the UNIX Environment": `The only two characters that cannot appear in a filename are the slash character (/) and the null character. The slash separates the filenames that form a pathname (described next) and the null character terminates a pathname.' Ciao, Stefan -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (3)
-
abrahams@valinet.com
-
chris.reeves@iname.com
-
stefan.troeger@wirtschaft.tu-chemnitz.de