Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!acorn!moncam!emmo From: emmo@moncam.co.uk (Dave Emmerson) Newsgroups: comp.sys.ibm.pc Subject: Re: Speeding up disk accesses - Food for thought. Summary: Oh well, if you think its worth it.. Message-ID: <372@marvin.moncam.co.uk> Date: 18 Jan 90 18:23:36 GMT References: <361@marvin.moncam.co.uk> <1360@mitisft.Convergent.COM> Organization: Monotype ADG, Cambridge, UK Lines: 62 In article <1360@mitisft.Convergent.COM>, burton@mitisft.Convergent.COM (Philip Burton) writes: > > > >Whenever I've formatted a hard disk I always begin by building the directory > >trees first, (that is, with NO FILES IN THEM). I have a small batch file > >on floppy which does most of this automatically. Another small programme > >creates this batch file if I want to copy/rebuild an existing disk. > > Any chance you could post these small batch files. They sound genuinely > useful. > I was quite surprised to get a few requests for this. I haven't the cheek to submit it to a .sources, you'll see why: It's just a few lines of basic (it wasn't worth any more effort than that). First, from DOS, enter TREE > TREE.TXT on the drive to be replicated. TREE.COM should be in your dos bundle. Then run the compiled basic programme, with a floppy in drive a: it produces a file on a: called diskdir.bat. After you've formatted and partitioned your new HD, log onto it, and run a:diskdir. I compiled it with Quickbasic at work, it shouldn't need much to port it to anything else, TREE did all the hard stuff. 'Nuff said, here it is.. Enjoy! Dave E. < cut here > rem Copyright and all rights donated to the public domain, D.J. Emmerson, rem 18th January, 1990. rem Quickie for creating a batch file to duplicate a directory tree structure rem onto a clean partition or new disk. rem Before running this, enter the following DOS command : rem TREE > TREE.TXT rem This programme expects to find the TREE.TXT file in the current drive rem and generates a batch file called DISKDIR.BAT on drive A: rem Diskdir.bat will create the directory tree structure on the new rem partition, BUT WILL NOT TRANSFER THE FILES INTO THEIR DIRECTORIES, rem as it cannot guess which ones should be copied first. rem This is crude, and has no error-checking, but it is simple and quick. print "Emmo's Batchfile generator for Directory Tree replication" print "Freeware Version 1.01, Aug '88" open "tree.txt" for input as #2 open "A:\diskdir.bat" for output as #3 for doline = 1 to 1000000 line input #2,l$ x = instr(l$,"Path") if x = 0 then goto TESTEOF l = (len(l$)) - 7 o$ = right$(l$,l) print #3,"mkdir ";o$ print o$, TESTEOF: if EOF(2) then close: Print "ALL DONE!" : system next doline