1
$\begingroup$

Is a computer file just a string of zeroes and ones? If so, can it start with zeroes?

I have not been able to find an answer, surprisingly.

$\endgroup$
1
$\begingroup$

Yes the File has a binary representation and it can start with a leading zero.

To verify this open any file from your computer with an hex editor and modify the leading hex to 00.

You would most likely be unable to open the file, because you damage the signature but it still can be considered a valid file.

$\endgroup$
0
$\begingroup$

The most common type of file is a binary file, which is composed of:

  • A stream of bytes, which can be completely arbitrary.
  • Metadata: name, length, owners, permissions, relevant dates, and so on.

This is the "view" of the file from the outside. From the inside, the file will also be associated with locations on disk. Furthermore, if the filesystem is journaled, recent changes to the file will also be stored.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.