Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watvlsi.UUCP Path: utzoo!watmath!watnot!watvlsi!ksbszabo From: ksbszabo@watvlsi.UUCP (Kevin Szabo) Newsgroups: net.unix-wizards Subject: Re: Summary of how to remove file with NULL names Message-ID: <2977@watvlsi.UUCP> Date: Tue, 22-Apr-86 12:27:09 EST Article-I.D.: watvlsi.2977 Posted: Tue Apr 22 12:27:09 1986 Date-Received: Wed, 23-Apr-86 21:41:10 EST References: <306@chinet.UUCP> Reply-To: ksbszabo@watvlsi.UUCP (Kevin Szabo) Distribution: net Organization: VLSI Group, Univeristy of Waterloo Lines: 37 Summary: another solution ... for null file names use clri and fsck >I had some programs blow on me and they opened a file with >a null file name. Almost as if I had done a 'open("",O_READ)' or such. >Now, I have a few files in my directory that show up with names like >!wvwu or u!wv. I tried a 'rm -i *' and I got a 'rm: !wvu non-existent' >error. We had null-named file trouble on our 4.1 BSD based work station; an OD of the directory showed the names to really be the null string! I think someone forgot to SYNC before shutting the machine down. I hope my solution is applicable to you. These are the steps I followed: 1) fsck the file system 2) find the Inode numbers of the weirdly named files. (ls -i) 3) use the program 'clri' to clear the inodes of the bad files. 4) run fsck again and let it clean up the directories, free list and reference counts. (you lose the files UNLESS you zap the parent directory, in which case you get a whole bunch of unreferenced inodes that go into lost+found). Null file names can be tricky because many systems interpret "" as equivalent to "." (i.e. the current directory). We had some null-named directories in our file system; it was a confusing mess to figure out. It looked like I had a directory linked to itself, but really LS was just getting the wrong info when it opened up the directory called "". I found that 'od' on the directory was useful to find these problems. Another useful proceedure is using 'rm -i -r' on the directory. This technique keeps the shell from seeing the file names and mangling non-ascii characters (8th bit = 1, etc.). Kevin Szabo' -- Kevin Szabo' ihnp4!watmath!watvlsi!ksbszabo (VLSI Group,U of Waterloo,Ont,Can)