Specifically, a Nachos' FileHeader contains the current size of the file in bytes, the number of sectors that have been allocated to the file and an array of sector numbers identifying the specific disk sector numbers where the file's data blocks are located. Recall that when a file is initially created, the caller specifies the size of the file. At file creation time, Nachos allocates enough sectors to match the requested size. Thus, as data is appended to the file, no sectors need be allocated. The current size field indicates how much of the file currently contains meaningful data.
Nachos uses a bit vector to keep track of which sectors are allocated and which are free.
This operation is invoked when a file is deleted from the system. Read the FileHeader stored in sector sectorNumber from the underlying disk. Return the current size of the file. Map the offset within a file into the actual sector number that contains that data byte. Because a FileHeader fits into a single sector, the sector number containing a FileHeader uniquely identifies that file.