delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/06/04:49:54

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
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019