SharpDevelop Community

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

Problem adding a file to a zip file using Dos 8.3 names

Last post 09-05-2008 4:52 PM by bwaechter. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-05-2008 4:52 PM

    Problem adding a file to a zip file using Dos 8.3 names

            Dim zip As ICSharpCode.SharpZipLib.Zip.ZipFile
            'Dim filename As System.String = "c:\program files\tt7466.doc"
            Dim filename As System.String = "c:\progra~1\tt7466.doc"
            Dim fi As New System.IO.FileInfo(filename)
            zip = ICSharpCode.SharpZipLib.Zip.ZipFile.Create("c:\temp\test.zip")
            zip.BeginUpdate()
            zip.NameTransform = New ICSharpCode.SharpZipLib.Zip.ZipNameTransform(fi.DirectoryName)
            zip.Add(filename, ICSharpCode.SharpZipLib.Zip.CompressionMethod.Deflated)
            zip.CommitUpdate()
            zip.Close()

    When using the first "filename" line this code will put the tt7466.doc file in the root directory of the zip file.  However, using the second "filename" line this code will put the file in a subdirectory named "progra~1".  It seems that the NameTransform property is being ignored when using the DOS 8.3 names.  Are there any plans to support the DOS 8.3 names?  I have code that is getting the user TEMP folder by calling  System.Environment.GetEnvironmentVariable("TEMP") and this is returning the 8.3 version of the path to the directory.

     Thanks for the help.

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