Files Disappear When Using .\ in the Filename

Jul 11, 2008 at 10:19 PM
I'm new to the DotNetZip Library, so forgive my stupid question/post.  I may have found a bug when writing data to a zip file.  After adding items to the zip archive, the zip file itself is blank when I open it using Windows XP Pro SP2 Windows Explorer. 

Here is my code...

 

Dim oZip As New Ionic.Utils.Zip.ZipFile("myzip.zip")
oZip.AddFile(
".\done.txt")
oZip.Save()

 

I came across this problem when I was trying to allow a user to enter a wildcard, like *.*. I used the System.IO.Directory.GetFiles(".\","*.*") to specify the current folder, then loop through those files and add them using Zip.AddItem. Nothing was showing up!!  WinRAR shows the files, but Windows XP Built-in compression didn't.  I was curious, so after further research I found that if I designated the current folder using ".\" then it would reproduce the same results.  Instead of using ".\" in my code, I am now using System.IO.Directory.GetFiles(System.IO.Directory.GetCurrentDirectory,"*.*")  This doesn't produce an error.  Can someone confirm that I am not crazy?? Thanks in advance.

-Jon

Coordinator
Jul 11, 2008 at 11:25 PM
maybe not such a dumb question.
let me look.
Coordinator
Jul 12, 2008 at 12:18 AM

You are not crazy.  It's a bug.  I'll strip the leading dot.