Path: utzoo!attcan!uunet!munnari!mimir!hugin!augean!sirius!eco!nt!levels!ccdn
From: ccdn@levels.sait.edu.au (DAVID NEWALL)
Newsgroups: comp.unix.wizards
Subject: Re: Ghost file
Summary: It's easy to get rid of Ghost files
Keywords: ghost, unprintable, unlink
Message-ID: <795@levels.sait.edu.au>
Date: 25 Nov 88 12:11:13 GMT
References: <17529@adm.BRL.MIL> <8430@alice.UUCP> <169@pinn.UUCP> <303@bilver.UUCP>
Organization: Sth Australian Inst of Technology
Lines: 24

I had an off by one bug in a "high level" file access library, once.  It's
effect was to append a single character (usually > 127) to the end of all
files created.  Needless to say, I couldn't generate the filename from
within the shell, and so I couldn't delete it using rm.

But it turned out to be easy, to write a C program to delete the file.  It
looked sort of like this:

main()
{
   char name[] = "badfile?";
   name[7] = (char) 255;
   unlink(name);
}

Of course, I had to use "od" to find out the value of the `bad' character.
(Ls, by default, displays unprintable characters as "?").

--

David Newall                     Phone:  +61 8 343 3160
Unix Systems Programmer          Fax:    +61 8 349 6939
Academic Computing Service       E-mail: ccdn@levels.sait.oz.au
SA Institute of Technology       Post:   The Levels, South Australia, 5095