[comp.binaries.ibm.pc.d] need directory pruner

terry@julia.math.ucla.edu (08/30/90)

Hi, netlanders!

I am looking for a program that will let me wipe out a whole hard disk 
very quickly.  I don't want to have to wipe out each individual file 
(a la a UNIX rm -r) or reformat the disk -- both of these options take
too long and are error-prone.  What would be ideal is something that
would just replace the root directory FAT with an empty one.  Also, 
I want this to be done from a batch file, not interactively.

I looked at PCMAG's PRUNE program, which prunes directory trees, but
it is interactive (imagine that!), and it won't prune the root.  I 
also checked out TREESURG, but it's not what I want either.

Does anybody know of a PD or shareware program that does this, and 
where I can get it, or of some method using standard DOS programs?

Please e-mail your responses and I will post a summary.  Thanks!

>>> terry <<<

rusin@mp.cs.niu.edu (David Rusin) (08/30/90)

Do I understand you right - all you want to do is wipe out FAT tables
and root directory entries but not format your hard disk? That's just
what formatting DOES do on a fixed disk (Hence the un-formatting
utilities such as Norton's)   

no .signature

williams@umaxc.weeg.uiowa.edu (Kent Williams) (08/31/90)

No, I don't have a disk nuker, but to write one wouldn't be hard.
The trick to killing directories fast is to use the FCB delete call.
Something like

nuke_dir(name) {
		for all directories X in name {
				change directory to name/X
				nuke_dir(X);
		}
		set all files read/write/visible;
		fcb_delete(*.*);
		/* everything left must be a directory */
		for all directories X in name {
				rmdir(name);
		}
}
nuke_dir("\\");

				
--
             Kent Williams ---  williams@umaxc.weeg.uiowa.edu 
"Had a dream one night/That the tree had lost its middle/So he built a trunk
  of chicken wire/To try to hold it up/But then the wire, the wire/Turned to 
        lizard skin/and he climbed inside" - 'Wendell Gee', by REM