Finally figured this out, its not in the manual (maybe for the best...)

-----------

julia> f = open("std.log","w")
IOStream(<file std.log>)

julia> p=spawn(`julia -e 'println("f");error("g")'`, Base.DevNull, f, f)
Process(`julia -e 'println("f");error("g")'`, ProcessRunning)

julia> close(f)

shell> cat std.log
f

ERROR: g
 in error at error.jl:21

-----------

On Wednesday, July 23, 2014 11:43:21 PM UTC-4, Elliot Saba wrote:
>
> I don't think there's much documentation on it, but the spawn() function 
> allows you to hook up streams to file descriptors. 
>
>
> On Wed, Jul 23, 2014 at 7:17 PM, Iain Dunning <[email protected] 
> <javascript:>> wrote:
>
>> What is the best way to capture STDOUT and STDERR from an external 
>> program?
>> If it can't be done separately, is there an equivalent to the bash-ism 
>>  ./myprogram 2>&1 > log.txt
>>
>
>

Reply via email to