Hi users,
Is there a simple way to read the entire input stream using blocking read(2)? I can select(2) stdin to avoid command blocking but wondered why not having an environment variable holding the input length like in a CGI environment ?
Sylvain
On 23/6/2006, at 18:17, Sylvain Benilan wrote:
Is there a simple way to read the entire input stream using blocking read(2)?
Yes, just read it :)
I can select(2) stdin to avoid command blocking but wondered why not having an environment variable holding the input length like in a CGI environment ?
TextMate will provide you with data on the pipe roughly as fast as you can read it, so there should be no fear of “blocking” -- and if there was, I don’t see how that could be avoided if your command actually needs the data.
Could you be more specific about what the problem is, if there is one? I.e. what command are you writing.
Le 23 juin 06 à 19:10, Allan Odgaard a écrit :
On 23/6/2006, at 18:17, Sylvain Benilan wrote:
Is there a simple way to read the entire input stream using blocking read(2)?
Yes, just read it :)
Indeed, I also did :)
Could you be more specific about what the problem is, if there is one? I.e. what command are you writing.
There is none, TM works perfectly! For the story, was a simple command written in Claire (A scripting language I work with) relying on read(2) for descriptor stream operation. But the command was launched without enough memory which made the command garbaging infinitely without having a chance to check the eof condition.
Many thanks, you made me figure that.
Sylvain