Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!oliveb!sun!gorodish!guy From: guy@gorodish.UUCP Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.xenix Subject: Re: Confused file name in directory Message-ID: <14303@sun.uucp> Date: Sat, 28-Feb-87 23:40:50 EST Article-I.D.: sun.14303 Posted: Sat Feb 28 23:40:50 1987 Date-Received: Mon, 2-Mar-87 05:11:58 EST References: <105@aob.UUCP> <563@aw.sei.cmu.edu.sei.cmu.edu> <5587@mimsy.UUCP> <6977@clyde.ATT.COM> Sender: news@sun.uucp Reply-To: guy@sun.UUCP (Guy Harris) Organization: Sun Microsystems, Mountain View Lines: 16 Xref: utgpu comp.unix.questions:1232 comp.unix.wizards:1181 comp.unix.xenix:133 >>In article <105@aob.UUCP> someone finds a directory entry with an >>embedded NUL, and has nothing handy to fix it. > >I have a public-domain c program call rmfile which is interactive >and lets you either delete or rename files (including those with >garbage characters in their names). I've never paid attention to >how it works, but I've used it and it DOES work. Unless this program does so by opening the raw disk and writing directly on the directories, it *cannot* work if you try to use it to handle files with embedded NULs in their names. Since the file names passed as arguments to UNIX system calls are C strings, which *by definition* cannot have embedded NULs, no UNIX system call can possibly refer to such a file (unless you throw in a system call that takes character arrays representing containing NON-NUL-terminated strings as arguments).