Kevin Burke
Kevin Burke

Reputation: 65024

File contains two EOF characters; what happens?

Will this screw up file size estimation on the file system? Will the filesystem overwrite everything past the first EOF character? How is this handled?

Upvotes: 0

Views: 1084

Answers (1)

cnicutar
cnicutar

Reputation: 182734

In Unix there is no EOF character. It's simply a concept, a value returned by getc to signal "this is the end (beautiful friend)". EOF is chosen so that getc (and friends) can't return it in any other case.

And about writing past the end of file, different filesystems do things differently.

  • Some will leave holes that don't actually occupy any space on the disk
  • Some will fill in the blanks with blanks (0)

Upvotes: 3

Related Questions