Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!bbn!aoa!mbr From: mbr@aoa.UUCP (Mark Rosenthal) Newsgroups: comp.unix.wizards Subject: Holey files, Batman! (Was: rm with a block scrub) Message-ID: <265@aoa.UUCP> Date: Wed, 20-May-87 21:05:18 EDT Article-I.D.: aoa.265 Posted: Wed May 20 21:05:18 1987 Date-Received: Sat, 23-May-87 14:24:55 EDT References: <7421@brl-adm.ARPA> <6899@alice.UUCP> Reply-To: mbr@aoa.UUCP (Mark Rosenthal) Organization: Adaptive Optics Assoc., Cambridge, Mass. USA Lines: 22 In article <6899@alice.UUCP> ark@alice.UUCP writes: >In article <7421@brl-adm.ARPA>, evins@nrl-radar.arpa writes: >> Does anyone know of a version of rm that allows you to scrub blocks >> clean before making them available, for BSD VAXes and Suns. > >Before you unlink the file, open it for output and write a block >of zeroes over every block of the file. Then sync() and unlink it. How do you deal with "holey" files? The method you describe could chew up humongous amounts of disk space. You could read through the file and only write over locations which are already non-zero, but this could run into significant processing time if the holes are large. In general, how can a utility tell where the "real" bytes in a file are, as opposed to the empty spots which read back as zero? Is there any way other than opening the raw disk and following through starting at the block pointers in the inode? Ya gotta run as root to get at the raw disk anyway (unless your system administrator is a real turkey). -- Mark of the Valley of Roses ...!{harvard,ima}!bbn!aoa!mbr ...!{wjh12,mit-vax}!biomed!aoa!mbr