help removing a file

Topher Eliot eliot at dg-rtp.dg.com
Fri Sep 7 02:36:46 AEST 1990


In article <1990Sep5.180847.21767 at zaphod.mps.ohio-state.edu>,
harmon at function.mps.ohio-state.edu (Jim Harmon) writes:
|> Could someone someone help me with removing a file. ...
|> I even tried doing `rm -i *` and it matches
|> zhangNevai.tex but says there's No such file or directory.

If 'rm -i *' fails, it is a bad one indeed.

This is just a guess, but perhaps the file name on disk has the high
(8th) bit on.  If this is the case, and the rm code is turning that
bit off somewhere, then that would explain why rm would find the file
and then not be able to unlink it.  Or perhaps the shell is expanding
the '*', but then turning off the 8th bit before passing it to rm.
Can you try 'rm -Ri .'?

You might have to write a little C program just to unlink it, that
passes a filename to the unlink system call without doing anything
that would cause the 8th bit of any of the characters to be turned off.

As I recall, some versions of ls have an option to print the weird
characters in file names as they really are, rather than turning them
into '?'.  If yours does, you could run such an ls command, and pipe
it through 'od -xc' to see what the character is.

Hope this helps.
--
Topher Eliot
Data General Corporation                eliot at dg-rtp.dg.com
62 T. W. Alexander Drive               
{backbone}!mcnc!rti!dg-rtp!eliot
Research Triangle Park, NC 27709        (919) 248-6371
Obviously, I speak for myself, not for DG.



More information about the Comp.unix.admin mailing list