D - Strange DMD Behavior with din.readLine();
- Justin Greenwood (19/19) Nov 23 2007 Hi,
- Benjamin Shropshire (3/26) Nov 24 2007 just a note: this NG is the old one, most people only watch the digitial...
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
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, -Justinjust a note: this NG is the old one, most people only watch the digitialmars.D tree of NGs
Nov 24 2007