I am wondering whether CSV.write() can write to a different non-gzip compressor.
julia> using DataFrames, CSV
julia> textbz2= open("test.txt.bz2", "w")
IOStream(<file test.txt.bz2>)
julia> open( `bzip2 -c`, "w", textbz2 ) do fo; println(fo, "hello"); end#do
julia> close(textbz2)
julia> x1= vcat(99,collect(1:2:9)); df= DataFrame( n1=x1, n2=x1.^2, n3=string.(collect('a':'f')), n4=sin.(x1) );
julia> csvbz2= open("test.csv.bz2", "w")
IOStream(<file test.csv.bz2>)
julia> open( `bzip2 -c`, "w", csvbz2 ) do fo; CSV.write(fo, df); end#do
ERROR: MethodError: no method matching seek(::Base.Process, ::Int64)
Closest candidates are:
seek(::IOStream, ::Integer) at iostream.jl:100
seek(::Base.GenericIOBuffer, ::Integer) at iobuffer.jl:241
seek(::Base.Libc.FILE, ::Integer) at libc.jl:96
...
Stacktrace:
[1] seekstart(::Base.Process) at ./iostream.jl:126
[2] with(::getfield(CSV, Symbol("##53#55")){Char,Char,String,Nothing,Bool,Tables.Schema{(:n1, :n2, :n3, :n4),Tuple{Int64,Int64,String,Float64}},Tables.RowIterator{NamedTuple{(:n1, :n2, :n3, :n4),Tuple{Array{Int64,1},Array{Int64,1},Array{String,1},Array{Float64,1}}}},UInt8,UInt8,UInt8,NTuple{4,Symbol},Int64}, ::Base.Process, ::Bool) at /Users/ivo/.julia/packages/CSV/uLyo0/src/write.jl:21
[3] #write#52(::Char, ::Char, ::Nothing, ::Nothing, ::Char, ::String, ::Nothing, ::Bool, ::Bool, ::Array{String,1}, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(CSV.write), ::Tables.Schema{(:n1, :n2, :n3, :n4),Tuple{Int64,Int64,String,Float64}}, ::Tables.RowIterator{NamedTuple{(:n1, :n2, :n3, :n4),Tuple{Array{Int64,1},Array{Int64,1},Array{String,1},Array{Float64,1}}}}, ::Base.Process) at /Users/ivo/.julia/packages/CSV/uLyo0/src/write.jl:139
[4] write(::Tables.Schema{(:n1, :n2, :n3, :n4),Tuple{Int64,Int64,String,Float64}}, ::Tables.RowIterator{NamedTuple{(:n1, :n2, :n3, :n4),Tuple{Array{Int64,1},Array{Int64,1},Array{String,1},Array{Float64,1}}}}, ::Base.Process) at /Users/ivo/.julia/packages/CSV/uLyo0/src/write.jl:135
[5] #write#51(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Base.Process, ::DataFrame) at /Users/ivo/.julia/packages/CSV/uLyo0/src/write.jl:111
[6] write(::Base.Process, ::DataFrame) at /Users/ivo/.julia/packages/CSV/uLyo0/src/write.jl:109
[7] (::getfield(Main, Symbol("##5#6")))(::Base.Process) at ./REPL[7]:1
[8] open(::getfield(Main, Symbol("##5#6")), ::Cmd, ::String, ::IOStream) at ./process.jl:617
[9] top-level scope at none:0
Why would a csv writer (not reader) need to seek? Or am I committing another mistake altogether, and just hit on a misleading error message?