Loss of file attribute "read only" after decompress

Apr 20, 2011 at 8:50 PM

Good day everyone.
I archive a folder with files with attributes "read only".
After unzipping all files loses the attribute "read only".
Where is my problem?
I would be grateful for the advice

Code is reduced to improve readability...

public void CompressDirectory(string localUpdateFolderPath, string tempUpdateFolderPath, string fileName, bool isRecoursivly)
        {

            SevenZipCompressor.SetLibraryPath(Path.Combine(Application.StartupPath, "7z.dll"));
            SevenZipCompressor compressor = new SevenZipCompressor();
            compressor.CompressionLevel = CompressionLevel.Normal;
            compressor.CompressionMethod = CompressionMethod.Default;
            compressor.ArchiveFormat = OutArchiveFormat.SevenZip;
            compressor.TempFolderPath = tempUpdateFolderPath;
            compressor.CompressDirectory(localUpdateFolderPath, Path.Combine(tempUpdateFolderPath,
                            fileName), isRecoursivly);
        }


public void DecompressDirectory(string localUpdatePath, string sourceFilePath, string destinationPath)
        {
            string applicationPath = Path.Combine(Application.StartupPath, "7z.dll");
            SevenZipCompressor.SetLibraryPath(applicationPath);
            SevenZipExtractor extractor = new SevenZipExtractor(@sourceFilePath)
            extractor.PreserveDirectoryStructure = true;
            if (extractor.Check())
               {
                 extractor.ExtractArchive(@destinationPath);
               }
         }