Re: [OT] Re: are there some special about '\x1a' symbol

2009-01-14 Thread Gabriel Genellina
En Tue, 13 Jan 2009 22:04:33 -0200, Terry Reedy tjre...@udel.edu  
escribió:



Gabriel Genellina wrote:
En Mon, 12 Jan 2009 12:00:16 -0200, John Machin sjmac...@lexicon.net  
escribió:



I didn't think your question was stupid. Stupid was (a) CP/M recording
file size as number of 128-byte sectors, forcing the use of an in-band
EOF marker for text files (b) MS continuing to regard Ctrl-Z as an EOF
decades after people stopped writing Ctrl-Z at the end of text files.

 This is called backwards compatibility and it's a good thing :)


But it does not have to be the default or only behavior to be available.


Sure. And it isn't - there are many flags to open and fopen to choose  
from...
The C89 standard (the language used to compile CPython) guarantees *only*  
that printable characters, tab, and newline are preserved in a text file;  
everything else may or may not appear when it is read again. Even  
whitespace at the end of a line may be dropped. Binary files are more  
predictable...


Delphi recognizes the EOF marker when reading a text file only inside the  
file's last 128-byte block -- this mimics the original CP/M behavior  
rather closely. I thought the MSC runtime did the same, but no, the EOF  
marker is recognized anywhere. And Python inherits that (at least in 2.6  
-- I've not tested with 3.0)


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


Re: [OT] Re: are there some special about '\x1a' symbol

2009-01-14 Thread Grant Edwards
On 2009-01-14, Gabriel Genellina gagsl-...@yahoo.com.ar wrote:
 En Tue, 13 Jan 2009 22:04:33 -0200, Terry Reedy tjre...@udel.edu  
 escribió:

 Gabriel Genellina wrote:
 En Mon, 12 Jan 2009 12:00:16 -0200, John Machin sjmac...@lexicon.net  
 escribió:

 I didn't think your question was stupid. Stupid was (a) CP/M recording
 file size as number of 128-byte sectors, forcing the use of an in-band
 EOF marker for text files (b) MS continuing to regard Ctrl-Z as an EOF
 decades after people stopped writing Ctrl-Z at the end of text files.
  This is called backwards compatibility and it's a good thing :)

 But it does not have to be the default or only behavior to be available.

 Sure. And it isn't

It _is_ the default behavior on some systems.  The default file
mode when you open a file in C or in Python is text mode.  In
text mode, Windows interprets a ctrl-Z as EOF, doesn't it?

-- 
Grant

--
http://mail.python.org/mailman/listinfo/python-list


Re: [OT] Re: are there some special about '\x1a' symbol

2009-01-13 Thread Terry Reedy

Gabriel Genellina wrote:
En Mon, 12 Jan 2009 12:00:16 -0200, John Machin sjmac...@lexicon.net 
escribió:



I didn't think your question was stupid. Stupid was (a) CP/M recording
file size as number of 128-byte sectors, forcing the use of an in-band
EOF marker for text files (b) MS continuing to regard Ctrl-Z as an EOF
decades after people stopped writing Ctrl-Z at the end of text files.


This is called backwards compatibility and it's a good thing :)


But it does not have to be the default or only behavior to be available.

Consider the Atucha II nuclear plant, started in 1980, based on a design 
from 1965, and still unfinished. People require access to the complete 
design, plans, specifications, CAD drawings... decades after they were 
initially written.
I actually do use (and maintain! -- ugh!) some DOS programs. Some people 
would have a hard time if they could not read their old data with new 
programs.
Even Python has a print statement decades after nobody uses a teletype 
terminal anymore...




--
http://mail.python.org/mailman/listinfo/python-list


[OT] Re: are there some special about '\x1a' symbol

2009-01-12 Thread Gabriel Genellina
En Mon, 12 Jan 2009 12:00:16 -0200, John Machin sjmac...@lexicon.net  
escribió:



I didn't think your question was stupid. Stupid was (a) CP/M recording
file size as number of 128-byte sectors, forcing the use of an in-band
EOF marker for text files (b) MS continuing to regard Ctrl-Z as an EOF
decades after people stopped writing Ctrl-Z at the end of text files.


This is called backwards compatibility and it's a good thing :)
Consider the Atucha II nuclear plant, started in 1980, based on a design  
from 1965, and still unfinished. People require access to the complete  
design, plans, specifications, CAD drawings... decades after they were  
initially written.
I actually do use (and maintain! -- ugh!) some DOS programs. Some people  
would have a hard time if they could not read their old data with new  
programs.
Even Python has a print statement decades after nobody uses a teletype  
terminal anymore...


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list