Pipe problem

D

Doug

This works with a small string, but not a large one (read returns an
empty string if i pass a large html file to tidy):

''

I am using windows and tried the standard pipe and win32pipe as well.

Doug
 
A

Albert Hofkamp

This works with a small string, but not a large one (read returns an
empty string if i pass a large html file to tidy):


''

I am using windows and tried the standard pipe and win32pipe as well.

Probably the standard pipe buffering problem.

As you know computer systems have a finite amount of memory, which is
used for many things, including buffering data written to a pipe.

The write(str) returns when you have written the entire contents out.
Since it is big, and tidy.exe also uses finite buffering, the latter
starts processing and returning data while you are writing. Since you
are not reading incoming data, the pipe in the other direction gets
full, tidy.exe becomes blocked, which in turn means your write() becomes
blocked.

Solution: read and write at the same time.


Albert
 
J

John J. Lee

[...]

Didn't see the OP, but (guessing tidy.exe is HTMLTidy): do you know
about mxTidy and uTidylib?


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top