Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #15142

Re: End of file mark

From Charlie Gibbs <cgibbs@kltpzyxm.invalid>
Newsgroups comp.os.linux.misc
Subject Re: End of file mark
Date 2015-08-10 21:16 +0000
Organization NewsGuy - Unlimited Usenet $23.95
Message-ID <mqb4c301hb@news4.newsguy.com> (permalink)
References <mqalh6$1fd$1@dont-email.me> <X9qdnXBEFbyDj1TInZ2dnUU7-amdnZ2d@giganews.com>

Show all headers | View raw


On 2015-08-10, Robert Heller <heller@deepsoft.com> wrote:

> At Mon, 10 Aug 2015 10:05:13 -0700 T <T@invalid.invalid> wrote:
>
>> Hi All,
>> 
>> Just a trivia question that does not need an answer.
>> 
>> Under VFS and EXT4, do text files have an End Of File
>> marker?  How do programs know when they are at the
>> end of a file?
>
> An EOF marker is only needed for file systems that only record file size
> in terms of storage blocks.  CP/M (and MS-DOS, which is ultimately based
> on CP/M) are that way.  UNIX file systems have *always* stored the exact
> size of the file in bytes as part of the inode structure.  This functionallity
> is retained in modern Linux file systems, like VFS, EXT4, and others.

Although MS-DOS text file input recognizes 0x1a as an EOF marker, this
isn't necessary, since the file system stores the file size to the byte.
In fact, all of my MS-DOS software took pains to ensure that the mark
was never written, and removed it if present.  An early version of MS-DOS
(3.1 IIRC) had a bug in COMMAND.COM such that if you redirected output to
append to a file (e.g. dir >>foo), an existing EOF mark was not overwritten,
causing all new data to be lost.

It's one more bit of backward compatibility that was just plain backward.
It lives on in Windows to this day.

-- 
/~\  cgibbs@kltpzyxm.invalid (Charlie Gibbs)
\ /  I'm really at ac.dekanfrus if you read it the right way.
 X   Top-posted messages will probably be ignored.  See RFC1855.
/ \  HTML will DEFINITELY be ignored.  Join the ASCII ribbon campaign!

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

End of file mark T <T@invalid.invalid> - 2015-08-10 10:05 -0700
  Re: End of file mark John Hasler <jhasler@newsguy.com> - 2015-08-10 12:40 -0500
    Re: End of file mark Richard Kettlewell <rjk@greenend.org.uk> - 2015-08-10 19:32 +0100
      Re: End of file mark Keith Thompson <kst-u@mib.org> - 2015-08-19 17:38 -0700
  Re: End of file mark The Natural Philosopher <tnp@invalid.invalid> - 2015-08-10 19:52 +0100
    Re: End of file mark Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2015-08-11 12:40 +0200
      Re: End of file mark The Natural Philosopher <tnp@invalid.invalid> - 2015-08-11 11:51 +0100
  Re: End of file mark Robert Heller <heller@deepsoft.com> - 2015-08-10 16:05 -0500
    Re: End of file mark Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-08-10 21:16 +0000
      Re: End of file mark Tom Hardy <rhardy702@gmail.com> - 2015-08-11 23:34 -0500
        Re: End of file mark Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-08-12 14:57 +0000
          Re: End of file mark Tom Hardy <rhardy702@gmail.com> - 2015-08-13 11:28 -0500
  Re: End of file mark T <T@invalid.invalid> - 2015-08-11 10:27 -0700

csiph-web