From: peuha AT cc DOT helsinki DOT fi (Esa A E Peuha) Newsgroups: comp.os.msdos.djgpp Subject: Re: FAT Question. Date: 6 Mar 1997 07:25:47 GMT Organization: University of Helsinki Lines: 23 Message-ID: <5flrhr$38a@oravannahka.Helsinki.FI> References: <331C5E79 DOT 6812 AT sirio DOT etsiig DOT uniovi DOT es> Reply-To: Esa DOT Peuha AT helsinki DOT fi NNTP-Posting-Host: kruuna-ether.helsinki.fi Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Roberto Galan Fernandez. (zzpar01 AT sirio DOT etsiig DOT uniovi DOT es) wrote: : Hi, All: : How can I covert one cluster number of the FAT (File Allocation : Table) to a logic sector number? : : The way I use is this: : : aux= 1+(nš_FAT_copies * nš_sectors_per_FAT) + : + (nš_directory_entries * nš_bytes_per_entry) You must divide this ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with bytes_per_sector. : : : logic_sector_number=(nš_cluster-2)*(nš_sectors_per_cluster)+(aux) Also don't trust that there is only one sector before FATs (for example, your physical drive may be divided to two or more logical drives). BTW, how is this related to djgpp? -- Esa Peuha student of mathematics at the University of Helsinki http://www.helsinki.fi/~peuha/