473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Pipe problem

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):

iin , iiout = popen2("tidy.exe -asxml")
iin.write(str)
iin.close()
iiout.read()

''

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

Doug

Jul 18 '05 #1
2 1888
On Sat, 13 Sep 2003 16:34:13 GMT, Doug <no************************@fu.bar.ws> wrote:
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):

iin , iiout = popen2("tidy.exe -asxml")
iin.write(str)
iin.close()
iiout.read()

''

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
--
Unlike popular belief, the .doc format is not an open publically available format.
Jul 18 '05 #2
Albert Hofkamp <ha*@se-126.se.wtb.tue.nl> writes:
On Sat, 13 Sep 2003 16:34:13 GMT, Doug <no************************@fu.bar.ws> wrote:
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):

>> iin , iiout = popen2("tidy.exe -asxml")
>> iin.write(str)
>> iin.close()
>> iiout.read()

[...]

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Frank de Bot | last post by:
Hi, occasionaly I find in my apache logs that fastcgi had a broken pipe error with php running as fastcgi. the logs are like this: -- > (32)Broken pipe: > FastCGI: comm with server...
1
by: Brad Murdoch | last post by:
im trying to run the select.selct() on a unix pipe, my expectation is that it will block untill there is something there to read, then continue. It seems to do this untill the pipe is written to...
5
by: richard | last post by:
I have a simple test to pass information from a client to a server using named pipe. what I really want is: when I type a line on the client, the server will output the line immediately. but to my...
7
by: Greg | last post by:
I am trying to implement the UNIX pipe command using C but with the "->" operator. Everything works fine with 1 pipe, but when I try to use 2 or more, it hangs up when reading the pipe_in...
2
by: FB's .NET Dev PC | last post by:
I am writing two services in VB.NET, one of which needs to send text strings to the other. After reading, I decided (perhaps incorrectly) that named pipes would be the best interprocess...
1
by: David Reed | last post by:
Is there any way to have one program run another arbitrary program with input from stdin and display the output as if you had run it in a shell (i.e., you'd see some of the output followed by the...
0
by: olaf.dietsche | last post by:
Hi, The system is Windows XP and DB2 v8.1.7. I'm trying to load a text file via named pipe into a table. I have two programs: the first program creates the named pipe, waits for a client...
2
by: Steve R. Hastings | last post by:
While studying iterators and generator expressions, I started wishing I had some tools for processing the values. I wanted to be able to chain together a set of functions, sort of like the...
2
by: Dhika Cikul | last post by:
Hello, I'm new in Python, i don't know my subject is correct or wrong. I have problem with my script. I want to change password with passwd password in python without user submitted anything...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.