Path: utzoo!attcan!uunet!dasys1!jpr From: jpr@dasys1.UUCP (Jean-Pierre Radley) Newsgroups: comp.unix.wizards Subject: Re: Ghost file Message-ID: <7732@dasys1.UUCP> Date: 16 Nov 88 16:58:34 GMT References: <17529@adm.BRL.MIL> <8430@alice.UUCP> Reply-To: jpr@dasys1.UUCP (Jean-Pierre Radley) Organization: TANGENT Lines: 37 In article <8430@alice.UUCP> debra@alice.UUCP () writes: >In article <17529@adm.BRL.MIL> ZAT011%DJUKFA11.BITNET@cunyvm.cuny.edu (Thomas Heil) writes: >>I got a little problem with a "ghost file". It appears when I list the >>contents of a directory, but it can't be accessed in any way - every >>program tells me it doesn't exist. It can't even be removed. But the >>directory (only containing that file) cannot be removed because it's not >>empty. And I can even create another file with the same name which then >>appears twice... >I would suspect that the name of the ghost file contains a non-printable >character, which doesn't show up when you try ls. A way to find out is >to make an octal dump of the directory. >Another way of trying to delete the file is to try to generate the name: >if it appears as "ghost" in the directory you could try >rm *g*h*o*s*t* More than likely, the "ghost file" does contain "bad" characters. "Bad" means that you probably can't enter these characters from the keyboard, and even if you've made an octal dump to see _all_ of the file name, you won't be able to type it as an argument to 'rm'. If the bad name starts with "-", 'rm' thinks it's an option, not a file name. If the bad name has backspaces or non-printable characters, then it may _appear_ on your terminal to have the "same" name as a another file. It may be so screwed up that the "*" metacharacter won't expand into such a bad name (and if the name starts with ".", then the "*" also won't help). How to stomp on such insects: Go to the directory in question and type "ls -i". Make a note of the inode number, say NNNNN, of the offender. Then: find . -inum NNNNN -exec rm {} \; -- Jean-Pierre Radley Honi soit jpr@dasys1.UUCP New York, New York qui mal ...!hombre!jpradley!jpr CIS: 76120,1341 y pense ...!hombre!trigere!jpr