OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Why would MS want to make XML break on UNIX, Perl, Python

[ Lists Home | Date Index | Thread Index ]

 From: "Alan Kent" <ajk@mds.rmit.edu.au>

> On Thu, Dec 20, 2001 at 03:54:02PM +1100, Rick Jelliffe wrote:
> > Sure, lets make XML unsuitable for use in UNIX pipes by allowing ^D.
> > And for Perl and Python text-processing programs that use standard in and 
> > expect EOF (^D or ^Z).
> 
> I cannot speak for all of the languages, but you certainly can send ^D
> down a UNIX pipe. I think you are mixing up the tty processing of human
> input and what is implemented in the OS/programming language. I don't
> think many people will by typing in XML documents by hand down a pipe! :-)
> Oh, and with UNIX I think you can send a ^D anyway by typing ^V^D
> (depending on your shell).

As I understand it, a file opened in text mode through stdio may have embedded ^D (UNIX) 
or ^Z (PC) converted to EOF by the standard library routines that read/write from/to
stdio and present them to the application. This is independent of terminal signals,
such as sending ^D to a shell.

See (for a C++ implementation) http://www.cplusplus.com/ref/cstdio/fopen.html
"Text mode. In text mode the end of file is assumed to be at first Ctrl-Z character. Some conversions can occur reading and writing with End Of Line / Feedback characters depending on your compiler and your Operating System."

So if you can send ^D down your UNIX pipes, it is because the specific programs in the 
pipeline happen to be reading the input stream in binary mode not text mode.  Generic 
programs (such as cat) should be written to use binary. 

For a little selection of related material (for Python, Perl, CGI, Haskel, C)
http://www.wdvl.com/Authoring/Languages/Python/Quick/python4_2.html
http://aspn.activestate.com/ASPN/Reference/Products/ActivePerl/faq/Windows/ActivePerl-Winfaq8.html  (see "readin from and writing to files mysteriously fails")
  http://cscene.org/topics/web/snibril-cgi1.xml.html
  http://www.haskell.org/ghc/docs/5.02.1/set/sec-prelstd.html
http://www.cs.mu.oz.au/~fjh/gnu-win32/bugs-list.html (see "Other Caveats at the bottom")
  http://www.cygwin.com/ml/cygwin/1997-04/msg00198.html

Cheers
Rick Jelliffe









 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS