I am learning F# and Deedle. I am trying to extract the contents of this TGZ File using SharpZipLib. I downloaded the TGZ to my local drive. I think I am close because out1 works, but out2 errs. I am sure the code could be written better with pipe forwarding or composition, but it first needs to work. Does anyone have any ideas?
open ICSharpCode.SharpZipLib.GZip
open ICSharpCode.SharpZipLib.Tar
let extract path filename =
let fullpath = Path.Combine(path, filename)
let inSt = File.OpenRead(fullpath)
let gSt = new GZipInputStream(inSt)
let tar = TarArchive.CreateOutputTarArchive(gSt)
let out1 = tar.ListContents
let out2 = tar.ExtractContents(path)
out2
extract "C:/Downloads/" "dragontail-12.4.1.tgz"
This is the error:
Error: System.NullReferenceException: Object reference not set to an instance of an object.
at ICSharpCode.SharpZipLib.Tar.TarArchive.ExtractContents(String destinationDirectory, Boolean allowParentTraversal) in /_/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs:line 620
at ICSharpCode.SharpZipLib.Tar.TarArchive.ExtractContents(String destinationDirectory) in /_/src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs:line 600
at FSI_0104.extract(String path, String filename)
at <StartupCode$FSI_0104>.$FSI_0104.main@()