Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ncar!boulder!sunybcs!rutgers!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: Nulling out the filename in Turbo C 1.5 Message-ID: <2711@bsu-cs.UUCP> Date: 23 Apr 88 17:34:25 GMT References: <554@picuxa.UUCP> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 25 Summary: be portable and well-behaved In article <554@picuxa.UUCP> rcr@picuxa.UUCP (Richard Court ) writes: >I would like to null out the entire filename from the FAT instead of just the >first character. I suspect you will get lots of replies telling you how to access the file allocation table directly. Don't. Too many programmers hastily do low-level nonportable stuff, and aren't around a year or two later when the software breaks and the frustrated user has to switch to a new product. I suggest the following portable approach. Reserve a funny single-character filename for your own use. Suppose it is "@". To remove the filename of your target file from the file allocation table, you: (a) delete any file called "@" if it exists (b) rename the file you are zapping to "@" (c) delete the new file "@" MS-DOS system calls exist to delete and rename files. Please double-check to make sure that the above does completely eradicate the filename from disk. -- Rahul Dhesi UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!dhesi