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.
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.Sign up to join this community
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:
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.