SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Problem with bzip

Last post 08-21-2008 9:12 PM by JohnReilly. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-21-2008 12:52 AM

    Problem with bzip

    I new at this .Im using  SharpZip to descompress a .bz file.I looked at the sample.The compressing works fine but when i try to decompress something i get an error

    If (False = rdCompress.Checked) Then

    ' Decompression of single-file archive

    Dim fsBZ2Archive As FileStream, fsOutput As FileStream

    Dim strOutputFilename As String

    fsBZ2Archive = File.OpenRead(txtFileName.Text)

    strOutputFilename = Path.GetDirectoryName(txtFileName.Text) & _

    Path.GetFileNameWithoutExtension(txtFileName.Text)

    fsOutput = File.Create(strOutputFilename)

    BZip2.Decompress(fsBZ2Archive, fsOutput)

    fsBZ2Archive.Close()

    fsOutput.Flush()    ------ Cannot access a closed file

    fsOutput.Close()

     

    Im using Visual Studio 2008

      Thanks in advance

  • 08-21-2008 9:12 PM In reply to

    Re: Problem with bzip

    Hi,

    Read the documentation.  The bzip2 class is a simple wrapper that closes the stream you pass in.  If you want to use the stream afterwards write another wrapper.

    hth, -jr-

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.