Files compressed as folders?

Jul 3, 2009 at 5:31 AM

Hey, I'm getting mindblown by this. I'm compressing a file (i.e. myfile.txt), and after compressing it I obtain my 7zip file. However, when I open it instead of a myfile.txt as a text file, I find a folder named myfile.txt.

This is the compressing code:

SevenZipCompressor szc = new SevenZipCompressor();
szc.CompressFiles(tmpDir, outFile, OutArchiveFormat.SevenZip);

Where tmpDir is the array with the content to be compressed (in this case, C:\test\myfile.txt) and outFile is the path to the 7z file (C:\test\compressed.7z).

Any help sorting this out will be greatly appreciated!

Jul 3, 2009 at 11:48 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jul 3, 2009 at 11:54 AM

Hey, you use the old version of SevenZipSharp! Upgrade to the 0.51 version or download the most recent svn checkout.

Jul 3, 2009 at 3:09 PM

Thanks for the quick reply.

Ok I'm using 0.51, but it's still doing the same thing.


This is what the compressing line has become:

szc.CompressFiles(tmpDir, outFile);

All I want to do is compress files, one per 7z file. Am I doing something wrong?

Jul 3, 2009 at 6:54 PM

Try the new, much improved 0.52 release. To compress a file, you code like

szc.CompressFiles("path to my new archive", "path to my first file", "path to my second file, etc.");

Jul 3, 2009 at 9:03 PM

I tried that, same output...

Here's a screenshot of what's going on

Jul 4, 2009 at 7:29 AM

this is ridiculos, i tested that kind of compression. Seems to wrongly determine file attributes. Please send a copy of such buggy archive to on my email gmarkhor at

Jul 4, 2009 at 7:32 AM

ah, and please write the version of 7z.dll you use and winrar

Jul 4, 2009 at 10:39 PM

I fixed it. The mistake was that it was not adding a backslash to the path (so it was something like c:\testmyfile.txt, and it read that as a folder...).

Thanks for all your help, and I'm very sorry for taking your time.