On 4/8/99 5:17 AM Stephen Turner ([EMAIL PROTECTED]) wrote:

>Is there anyone who knows about how files are stored on disk in Windows?
>
>At the moment, analog on Windows stops processing logfiles if a CTRL-Z
>(ASCII 26) character is reached, because this signifies end-of-file for
>a text file. Sometimes logfiles get some junk in and then the file can be
>terminated prematurely.
>
>Because of this, I am considering opening files as binary rather than as
>text on Windows. I can cope with the CRLF -> LF conversion, but what I
>don't know is whether this will have any other undesirable side effects.
>In particular, will I miss some genuine ends-of-files and start reading past
>the end?
>
>Anyone know about this stuff, or know how I can find out?

Ah, good old CP/M-80. Under CP/M-80 all files were made up of some number 
of complete disk sectors and there was no logical end of file. So having 
a control-Z as the end of a text file was used when the file didn't run 
to exactly the end of a disk sector. This "feature" was brought along to 
MS-DOS and now to Windows. Most compiler libraries still support the 
control-Z ends a text file convention even though it is hardly ever used 
anymore. Windows has had file lengths to the character since MS-DOS 1.0, 
but they wanted to make it easy to port CP/M-80 programs so they 
encouraged the control-Z convention. Now it doesn't matter at all.

Other than using CR LF for a new line, Windows files are exactly the same 
as Unix files when you are in binary mode. You shouldn't have any 
problems if you handle the new line sequence.

Jason

-----------------
[EMAIL PROTECTED]
-----------------
Dr. Seuss books . . . can be read and enjoyed on several levels. For
example, 'One Fish Two Fish, Red Fish Blue Fish' can be deconstructed
as a searing indictment of the narrow-minded binary counting system.
  -- Peter van der Linden, Expert C Programming, Deep C Secrets


--------------------------------------------------------------------
This is the analog-help mailing list. To unsubscribe from this
mailing list, send mail to [EMAIL PROTECTED]
with "unsubscribe analog-help" in the main BODY OF THE MESSAGE.
--------------------------------------------------------------------

Reply via email to