> 
> Sorry Aaron, I don't know what could be causing the problem.  However, 
> the fact that there are fewer  write()s  when the ouput is a file is 
> to be expected.  Output is "block-buffered" if the output is not a 
> terminal, which means it saves up 4096 bytes before writing.  If the 
> output is a tty, the data is "line-buffered", which means it is 
> written after every '\n'.

This explains all the small writes to the terminal and the 4K to the file.

> 
> There *shouldn't* be a need to flush stdout unless the program exits 
> abnormally (e.g. segfaults).  Is the resulting file a multiple of 
> 4096 bytes long?  What happens if you simply pipe the output through  
> more/less?  Is it still truncated?

The entire stdout to a file is 12315 bytes.  If you remove all the header:
Content-type: text/html^M
^M

the file becomes 12288 (4096 * 3).  The same problem is seen when i pipe the output to 
less.

Thanks,
-ab


-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
htdig-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/htdig-dev

Reply via email to