From 5d8bd7b69bcc0713a5a08e3d58dea87b40e3d554 Mon Sep 17 00:00:00 2001 From: Nadya Atanasova Date: Thu, 1 Oct 2015 15:41:35 +0300 Subject: [PATCH] Use enum as flag correctly Check PreserveFileTime when file times are initialized. --- SharpCompress/Archive/IArchiveEntry.Extensions.cs | 2 +- SharpCompress/Common/ExtractOptions.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SharpCompress/Archive/IArchiveEntry.Extensions.cs b/SharpCompress/Archive/IArchiveEntry.Extensions.cs index fd98d695..91f82f68 100644 --- a/SharpCompress/Archive/IArchiveEntry.Extensions.cs +++ b/SharpCompress/Archive/IArchiveEntry.Extensions.cs @@ -90,7 +90,7 @@ namespace SharpCompress.Archive FileInfo nf = new FileInfo(destinationFileName); if (nf.Exists) { - if (options.HasFlag(ExtractOptions.PreserveAttributes)) + if (options.HasFlag(ExtractOptions.PreserveFileTime)) { if (entry.CreatedTime.HasValue) { diff --git a/SharpCompress/Common/ExtractOptions.cs b/SharpCompress/Common/ExtractOptions.cs index 99e0ca8b..0aff140e 100644 --- a/SharpCompress/Common/ExtractOptions.cs +++ b/SharpCompress/Common/ExtractOptions.cs @@ -5,26 +5,26 @@ namespace SharpCompress.Common [Flags] public enum ExtractOptions { - None, + None = 0, /// /// overwrite target if it exists /// - Overwrite, + Overwrite = 1 << 0, /// /// extract with internal directory structure /// - ExtractFullPath, + ExtractFullPath = 1 << 1, /// /// preserve file time /// - PreserveFileTime, + PreserveFileTime = 1 << 2, /// /// preserve windows file attributes /// - PreserveAttributes, + PreserveAttributes = 1 << 3, } } \ No newline at end of file