Record count, end-relative seek and disk blocks

A sensor archive is a binary file with no header, made of fixed-length records of 100 bytes each, indexed from 0. The file is 25,600 bytes long, and the disk transfers data in 512-byte blocks numbered from 0, with block 0 starting at byte 0 of the file. Find, each as an exact integer:

  • the number of records in the file;
  • the offset in bytes to pass to fseek with SEEK_END to reach the start of the record with index 250;
  • the number of the block that holds the first byte of record 250;
  • the number of the block that holds the last byte of record 250.
Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Block Files and Random Files Questions: