SharpDevelop Community

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

Error adding files to existing zipfile

Last post 03-04-2008 6:25 PM by J1mb0. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-04-2008 1:56 PM

    • J1mb0
    • Not Ranked
    • Joined on 03-04-2008
    • Posts 2

    Error adding files to existing zipfile

    Hi all!

    I'm trying to update a existing zipfile adding serveral files, but when i call "CommitUpdate" i receive a exception with a text similar to "File name of original file.zip.xxx.tmp" not found.

     The code used to update zip:

     Dim zipFileO As Zip.ZipFile

    zipFileO = New Zip.ZipFile(ZipFile)

    zipFileO.NameTransform = New NameTransformRelativePath(RelativePath) 'used to remove the entire path of files and leave a relative path.

    Dim astrFiles() As String = FileSystemHelper.GetFiles(DirPath)

    For Each strFile As String In astrFiles

    zipFileO.BeginUpdate()

    zipFileO.Add(strFile)

    zipFileO.CommitUpdate()   'This metod call fires a FileNotFound Exception

    Next

    zipFileO.Close()

    What is wrong at this code?

    Thanks for replies!

  • 03-04-2008 6:25 PM In reply to

    • J1mb0
    • Not Ranked
    • Joined on 03-04-2008
    • Posts 2

    Re: Error adding files to existing zipfile

    Problem Solved :)

     I'm using .NET 1.1 at current project. At this framework version FileStream aren't yet disposable (not implements iDisposable interface), and calling ".Close()" metod, file resources remains in memory.

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.