[net.unix] embedded '/' in a filename???

raman@sbcs.UUCP (Prabhakaran Raman) (02/22/85)

Is it possible to create a file with an
embedded '/' in its name ?

raman!sbcs

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (02/24/85)

> Is it possible to create a file with an embedded '/' in its name ?

It's not supposed to be.  On some systems one could set the "high bit"
on characters like '\\' and '\0' to get them into filenames.  Not
recommended.

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (02/24/85)

In my posting just now, I meant '/', not '\\'.  Sorry..

seth@megad.UUCP (Seth H Zirin) (02/25/85)

> Is it possible to create a file with an
> embedded '/' in its name ?

It is not possible to create such a file using "normal means".  The kernel
function which converts a path name into an inode pointer (namei) uses the
'/' (slash) as a delimiter for file name components (name pieces).

If you managed to embed a slash in the name of a file using extraordinary
means on its parent directory, it would be "rather difficult" to open (or
unlink, stat or mount on to name a few).

Why not consider using a backslash instead ?  With a backslash you'll only
have to battle the shell.

-- 
Name:	Seth H Zirin
USmail:	Megadata Corp. 35 Orville Dr., Bohemia, NY 11716
Phone:	516-589-6800 (M-F 9-5 EST)
UUCP:	{allegra, philabs}!sbcs!megad!seth

Keeper of the News for megad

jc@mit-athena.UUCP (John Chambers) (02/28/85)

I agree with the flames; I hope I never have a reason to want to do such
a silly thing.  My question is: how do you rename a file that has a '/'
embedded in its name?

I had to do this once.  It was probably 2 bits flipped on the disk.  I had
to write a C program that went and diddled the specific byte in the file.
I've had similar problems on almost every system I've worked on for more
than a few months.  Sure, file names shouldn't ever contain garbage char-
acters.  So what do you do when one pops up?  

			John Chambers

al@mot.UUCP (Al Filipski) (03/08/85)

>..............  My question is: how do you rename a file that has a '/'
>embedded in its name?
 

fsdb(1M) lets you change the name of a file based on its position
in a directory.

--------------------------------
Alan Filipski, UNIX group, Motorola Microsystems, Tempe, AZ U.S.A
{seismo|ihnp4}!ut-sally!oakhill!mot!al
--------------------------------
Time flies like an arrow; fruit flies like a bananna.