Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!convex!texsun!newstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga.tech Subject: Re: dos_stuff Keywords: fast,faster,fastest Message-ID: <126318@sun.Eng.Sun.COM> Date: 13 Oct 89 21:17:37 GMT References: <5546@ucdavis.ucdavis.edu> <126083@sun.Eng.Sun.COM> <4339@sugar.hackercorp.com> Sender: news@sun.Eng.Sun.COM Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 83 In article <4339@sugar.hackercorp.com> (Peter da Silva) writes: >Is this a significant problem with only one file to open? That is, once the >file is open, will it continue to slow things down to have the header block >on a different track? Last time I checked the floppy file system did not cache the header blocks specially (unlike FFS which does). Thus if the file itself was bigger than your addbuffers command you could find yourself rereading the directory and header blocks. On the question of exactly what do you have to do to make this happen, the answer is straightforward, but not exactly simple. You have to use the trackdisk.device to circumvent DOS being helpful in laying the blocks down for you. But the cheap way goes something like this : Format a fresh floppy, use Leo's used block display program (Fm) from Fish Disk 36 to note which blocks are used and not used. You should be able to find several tracks that are not used. Then declare an array in your code that looks something like : /* Note that the ExtensionBlock and DataBlock structures can be derived * from information in the DOS Technical Reference manual (or the Bantam * AmigaDOS manual), or from some structures Carolyn posted on BIX. * NOTE: Must be in CHIP Ram for floppies. */ struct HeaderBlock *HB; struct ExtensionBlock *EB; struct DataBlock *DB; ULONG *RawData; ... /* Number of blocks needed to hold the data */ DataBlockNum = ((FileDataSize + 487)/488); /* Number of extension blocks that will be needed */ Extension_Blocks = (DataBlockNum - BLOCKS_IN_HEADR)/BLOCKS_IN_EXT; /* Total blocks (1 == Header block) */ FileSize = DataBlockNum + Extension_Blocks + 1; RawData = (ULONG *)AllocMem(FileSize*512, MEMF_CHIP+MEMF_CLEAR); InitializeHB(RawData); /* Fill in the header block */ for (i=0; i