On Friday, January 30, 2015 at 12:25:25 PM UTC+10, eric l wrote: > > So here is the code > > function shllinout(some::ASCIIString) > rd,wr = redirect_stdout() > open (`sed 's/666//g'`,"w",STDOUT) do iob > println (iob,some) > end > eof(rd) > close(rd) > outoff = readall (rd) > redirect_stdout (STDOUT) > return outoff > end > > if sizeof(some) < ~50000 fct() works and return what I am expecting > > if the variable some is more than 100KB the code hang in the println(). > > I tried reducing the size of the write to iob and flushing regularly but > no success! > > So my question is is there some kind of limitation on the size that can > be written to a shell cmd? >
The answer is "No, but..." There is a limit on the amount of unread data that can be written to a pipe, 64k on Linux and 4k on Windows IIUC. Thats not a problem if the reading end keeps removing stuff from the buffer, but if its blocked for any reason, for example because it has filled up the return pipe that it is writing to, then everything will block until you read the return pipe. But of course you are not trying to read that until after your write is complete. Cheers Lex > > Thxs, > > -Eric > > PS: > > *julia> **versioninfo()* > > Julia Version 0.3.5 > > Commit a05f87b* (2015-01-08 22:33 UTC) > > Platform Info: > > System: Darwin (x86_64-apple-darwin13.4.0) > > CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz > > WORD_SIZE: 64 > > BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell) > > LAPACK: libopenblas > > LIBM: libopenlibm > > LLVM: libLLVM-3.3 > > > >
