Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!samsung!munnari.oz.au!uniwa!cc.curtin.edu.au!cutmcvax!campbell From: campbell@cutmcvax.cs.curtin.edu.au (Trevor George Campbell CC361) Newsgroups: comp.lang.pascal Subject: Re: Reading out my FAT part II, please help me!!! Message-ID: Date: 22 May 91 12:24:14 GMT References: <26884@adm.brl.mil> Sender: news@cutmcvax.cs.curtin.edu.au (Usenet News System) Organization: Curtin University of Technology, Computing Science Lines: 32 Nntp-Posting-Host: cutmcvax.cs.curtin.edu.au CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) writes: >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. You do need to read the FAT as that is the only place that you can get the number of the next cluster. DOS uses the FAT to store the chain of the Files blocks. The clustor that a file occupies includes ONLY the data from the file, and NO pointers to the next cluster that a file uses. The cluster number is uses as an offset into the FAT to determine the next cluster number. Once you have the cluster number of the first cluster then you don't need any more information that the FAT for the disk. -- Trevor alias <****>