Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!rutgers!cmcl2!adm!news From: CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) Newsgroups: comp.lang.pascal Subject: Re: Reading out my FAT part II, please help me!!! Message-ID: <26885@adm.brl.mil> Date: 14 May 91 13:33:42 GMT Sender: news@adm.brl.mil Lines: 40 In article <9857@star.cs.vu.nl> erwvegm@cs.vu.nl (Erwin van Egmond) wrote: > A while ago I asked something about reading out my FAT. > Well, I got a lot of response but nothing that could really > help me. > What I want is this : > I have a file (Any file) and I want to know > at which sector/cluster this file is placed. > I want to find this out with TP5.5 > This means that I'm looking for a program > that finds the beginning of my FAT, searches > this FAT and returns the sector/cluster number > of the file. I don't think you need to touch the FAT directly at all. The directory entry for the file includes the starting cluster (two bytes (a word) at offset $1A into the entry). Only if you then want to trace the file's chain of clusters do you need to access the FAT itself. To actually get at the directory entry, you're largely on your own. DOS functions $11 and $12 return a copy of the entire entry, including the starting cluster. However, they use FCBs and don't take paths, so I think you're forced into changing into the target file's subdirectory to use them. (Functions $4E and $4F don't use FCBs, but for some reason they don't return the starting cluster.) If you're wanting code, maybe this will help you create some. (I don't have any or maybe I'd post it. :) ) If OTOH you truly want "a program" which you can run to do this (and more FAT reporting), look for Chris Dunford's FAT. (Try checking SIMTEL for FAT*.*.) +====================================================================+ | Karl Brendel Centers for Disease Control | | Internet: CDCKAB@EMUVM1.BITNET Epidemiology Program Office | | Bitnet: CDCKAB@EMUVM1 Atlanta GA 30093 USA | | Home of Epi Info 5.0 | +====================================================================+