LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how do i escape a / ??? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-escape-a-229469/)

Fascistchicken 09-11-2004 06:06 PM

how do i escape a / ???
 
how do you escape a \ (forward slash character) in a file name?

Tinkster 09-11-2004 06:10 PM

With a backslash?

But how did you manage to create such abomination
of a file-name? :)


Cheers,
Tink

trickykid 09-11-2004 06:12 PM

Or put quotes around it might also work??

Fascistchicken 09-11-2004 06:56 PM

old dos disks

Fascistchicken 09-11-2004 07:01 PM

i mean forward slash sorry

frob23 09-11-2004 08:11 PM

You cannot....

It is not possible to create a file with a / in it.

Why do you *need* a file like this?

Edit: I suppose you want to know how I am sure of this.

All filenames are passed to the kernel. The kernel has to find the inode associated with the filename. It does its own parsing... it ALWAYS interperts a "/" as a break between a directory and file. The name "foo/man" can never be a file because it will ALWAYS be seen by the kernel as file man in the directory foo. You cannot override this behavior without going to extremes and even then the file will be completely useless as every utility will be unable to find it.

Extreme measures: umounting the partition and physically manipulating the contents of a directory file... very dangerous and stupid.

Fascistchicken 09-11-2004 08:53 PM

on old dos program install disks 'they' made f'ed directories and files so youd have trouble installing,copy without the original disks
they have chars like ascii 13 or so in them
so i was wondering

frob23 09-11-2004 09:37 PM

Are you trying to install the program or just copy the disk?

What exactly are we trying to do here? :D

btmiller 09-11-2004 10:10 PM

One other way to deal with this is that emacs has a directory editor mode. Do 'emacs <parent directory> and it should open in directory editor mode (not sure if it will work on FAT, but worth a try). Be carefull in there, but you ought to be able to at least rename the file. You'll need to google.check documentation for more details.

Fascistchicken 09-11-2004 11:54 PM

i was actually going to make a lil floppy iso and then try to mount it as a virtual dos a:
and install from there with dosemu
id say a little more but i dont have the disks at hand

frob23 09-12-2004 11:28 AM

Quote:

Originally posted by btmiller
One other way to deal with this is that emacs has a directory editor mode. Do 'emacs <parent directory> and it should open in directory editor mode (not sure if it will work on FAT, but worth a try). Be carefull in there, but you ought to be able to at least rename the file. You'll need to google.check documentation for more details.
Have you actually tried this?

You cannot modify a directory through ANYTHING but the operating system. It pretends to be a file but you cannot open it for writing... never... no matter who you are (not even root) or what permissions it has.

All attempts to modify a directory must be made through system calls... and every system call is going to resolve that "/".

If you have gotten this to work... I would love if you would give me a detailed tutorial on how to do it. I am very interested... it might come in useful. Note: I firmly believe this is not possible without editing the raw disk -- below the level of filesystems and operating systems...


All times are GMT -5. The time now is 05:23 PM.