Is there an easy way to write a composite and then read it back in?


#1

Is it possible to write a vector of composites to a file in such a way that it can be read back in, somewhat similar to the following?

ILGPennTreebank=Vector{ILGPennTreebankRow}()
##push elements onto above vector, then
  open(savebin_ILGPT_Dataset, "tmp.bin","w")
  open(readbin_ILGPT_Dataset, "tmp.bin")

function savebin_ILGPT_Dataset(archiveDS::IOStream)
  println("Archiving")
  write(archiveDS,ILGPennTreebank)
end

function readbin_ILGPT_Dataset(archiveDS::IOStream)
  println("Reading archive")
  tmp=read(archiveDS,Vector{ILGPennTreebankRow})
  println(tmp)
end

#2

See package JLD
https://github.com/JuliaIO/JLD.jl