سؤال

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.

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى cs.stackexchange
scroll top