www.digitalmars.com         C & C++   DMDScript  

D - Strange DMD Behavior with din.readLine();

reply Justin Greenwood <jgreenwood37 insightbb.com> writes:
Hi,
I've been working on a CGI web framework and ran into some unexpected 
behavior from din.readLine when looping through a data stream coming in 
from a multipart form web request. It seems that it is adding an extra 
blank line after each expected line. This could be due to bad code 
splitting the line at the CR and then again at the LF instead of seeing 
that as one EOL sequence. According to the docs, this doesn't seem like 
the correct behavior. when I output the data reading in character by 
character, everything looks correct. Here is the code:

while (!din.eof)
{
	line = din.readLine();
	...
}

I am running the DMD compiler on fedora core linux using Phobos. Any 
ideas? Is this how it's supposed to work or is there something I'm doing 
wrong?

Thanks much for any help,
-Justin
Nov 23 2007
parent Benjamin Shropshire <ao pathlink.com> writes:
Reply to Justin,

 Hi,
 I've been working on a CGI web framework and ran into some unexpected
 behavior from din.readLine when looping through a data stream coming
 in
 from a multipart form web request. It seems that it is adding an extra
 blank line after each expected line. This could be due to bad code
 splitting the line at the CR and then again at the LF instead of
 seeing
 that as one EOL sequence. According to the docs, this doesn't seem
 like
 the correct behavior. when I output the data reading in character by
 character, everything looks correct. Here is the code:
 while (!din.eof)
 {
 line = din.readLine();
 ...
 }
 I am running the DMD compiler on fedora core linux using Phobos. Any
 ideas? Is this how it's supposed to work or is there something I'm
 doing wrong?
 
 Thanks much for any help,
 -Justin
just a note: this NG is the old one, most people only watch the digitialmars.D tree of NGs
Nov 24 2007