Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!aplcen!unmvax!pprg.unm.edu!topgun.dspo.gov!lanl!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.wizards Subject: Re: Two identical filenames in one directory! Message-ID: <11177@smoke.BRL.MIL> Date: 28 Sep 89 15:11:50 GMT References: <22@minya.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 25 In article <22@minya.UUCP> jc@minya.UUCP (John Chambers) writes: >On earlier versions of Unix, I'd know instantly what to do. It's easy enough >to write a program that runs thru a directory and extends each null byte to >the end of the entry. But on Sys/V, this doesn't work, because nobody, not >even root, can write a directory. For just this one entry, you should be able to patch the raw disk image. >I might observe that this is a clear violation of the principle that sofware >should be conservative in what it produces and liberal in what it accepts. The root cause of the problem is that directory entries were designed for all 14 allocated characters to be usable, so there may not be a null-byte terminator. That's why the kernel uses the funny strcmp method that it does. One hopes that this is fixed in the FSS-based (or VFS-based) UNIX implementations. There is a lesson there.. >Does anyone know a solution to this problem, ... Other than patching the raw disk, you could move all the other files to a new directory, unlink whatever you can from the broken directory, then use fsck to discard what's left (here's hoping fsck doesn't insist on reconstructing the links you removed).