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.