Ok, the 
docs http://docs.julialang.org/en/release-0.4/stdlib/io-network/#Base.IOBuffer 
seem to say it creates an IOStream, and pipeline says it accepts 
one 
http://docs.julialang.org/en/release-0.4/stdlib/base/?highlight=pipeline#Base.pipeline
 
so one of them is wrong.

On Sunday, 13 March 2016 10:49:55 UTC+10, J Luis wrote:
>
> Thanks but doesn't work either
>
> a = IOBuffer();
> print(a, P.ps);
>
> julia> run(pipeline(a, `gswin64c -q -dSAFER -dNOPAUSE -dBATCH 
> -sDEVICE=bbox -`))
> ERROR: MethodError: `uvtype` has no method matching uvtype(::Base.
> AbstractIOBuffer{Array{UInt8,1}})
>  in _jl_spawn at process.jl:253
>
>
>
> domingo, 13 de Março de 2016 às 00:36:19 UTC, ele...@gmail.com escreveu:
>>
>> Can't test ATM, but argument one IOBuffer(ps_string) ?
>>
>> On Sunday, 13 March 2016 09:52:52 UTC+10, J Luis wrote:
>>>
>>> Hi,
>>>
>>> I need to reproduce a similar behavior of this on command line. 
>>>
>>> cat barco.eps | gswin64c -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -
>>> %%BoundingBox: 0 0 71 64
>>> %%HiResBoundingBox: 0.000000 0.000000 70.865998 63.305998
>>>
>>> What it does is to send the contents of a PostScript file (ascii file) 
>>> through ghostscript and get the result printed on stdout
>>>
>>> Now, instead of a file I have in Julia the contents of that file as a 
>>> long string and wanted to feed it to ghostscript, first to do the 
>>> BoundingBox query and later on to convert the ps into a raster. So I tried
>>>
>>>  run(pipeline(P.ps, `gswin64c -q -dSAFER -dNOPAUSE -dBATCH 
>>> -sDEVICE=bbox -`))
>>> ERROR: open: no such file or directory (ENOENT)
>>>  in open at fs.jl:82
>>>
>>> I guess the reason lies on the *pipeline *manual mention when it says 
>>> that "Strings refer to filenames". So given that P.ps above is a string 
>>> it tries to open it as a file.
>>> So my question is, how can I put the string inpipeline's first argument 
>>> and get the output in a Julia variable?
>>>
>>> Thanks
>>>
>>> Joaquim
>>>
>>

Reply via email to