Use enum as flag correctly

Check PreserveFileTime when file times are initialized.
This commit is contained in:
Nadya Atanasova
2015-10-01 15:41:35 +03:00
parent 91fc241358
commit 5d8bd7b69b
2 changed files with 6 additions and 6 deletions

View File

@@ -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)
{

View File

@@ -5,26 +5,26 @@ namespace SharpCompress.Common
[Flags]
public enum ExtractOptions
{
None,
None = 0,
/// <summary>
/// overwrite target if it exists
/// </summary>
Overwrite,
Overwrite = 1 << 0,
/// <summary>
/// extract with internal directory structure
/// </summary>
ExtractFullPath,
ExtractFullPath = 1 << 1,
/// <summary>
/// preserve file time
/// </summary>
PreserveFileTime,
PreserveFileTime = 1 << 2,
/// <summary>
/// preserve windows file attributes
/// </summary>
PreserveAttributes,
PreserveAttributes = 1 << 3,
}
}