Dave,

Sure, but then the command shell must then be doing something that OSProcess 
should do: transfer "large" (1MB isn't much these days) blobs in pieces that 
are manageable.  The questions are where does it belong, and what if anything 
is necessary to ensure the pipe is ready for the next piece?

One thought would be

AttachableFileStream>>nextPutAll:blob
| in |
in := ReadStream on:blob.
[ in atEnd ] whileFalse:[
     self nextPutAll:( in next:32000).
].

but it should run into the same problem after a few times through the loop.  It 
needs some "flow control" and could easily belong elsewhere in the hierarch??  
The above assumes the (should be changed) silent truncation of #next:.

Bill


________________________________________
From: pharo-project-boun...@lists.gforge.inria.fr 
[pharo-project-boun...@lists.gforge.inria.fr] On Behalf Of David T. Lewis 
[le...@mail.msen.com]
Sent: Sunday, August 29, 2010 12:37 PM
To: Pharo-project@lists.gforge.inria.fr
Subject: Re: [Pharo-project] OSProcess - can it pipe 1 MB?

On Sun, Aug 29, 2010 at 11:36:02AM -0400, Schwab,Wilhelm K wrote:
> I am trying to pipe roughly 1 MB of data into a program on Linux; I know it 
> can handle the load, because I have tested it with by cat-ing a script and 
> the data.  I do not yet promise that my Pharo code is correct; if the program 
> did not respond or returned junk, I would look to myself.  But I am getting 
> errors suggesting that AttachableFileStream is failing on writing to the 
> pipe, and it's very suspicious that it simply can't handle the size of the 
> string.  Any ideas?
>
> Bill

Try googling "maximum size of write to linux pipe". Unix pipes
have a capacity limit, and the write will fail if you try to write
too large a chunk all at once.

Dave


_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to