File tree 3 files changed +10
-7
lines changed
src/SharpCompress/Common/SevenZip
3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -996,6 +996,11 @@ out digests
996
996
numFiles ,
997
997
delegate ( int i , uint ? attr )
998
998
{
999
+ // Keep the original attribute value because it could potentially get
1000
+ // modified in the logic that follows. Some callers of the library may
1001
+ // find the original value useful.
1002
+ db . _files [ i ] . ExtendedAttrib = attr ;
1003
+
999
1004
// Some third party implementations established an unofficial extension
1000
1005
// of the 7z archive format by placing posix file attributes in the high
1001
1006
// bits of the windows file attributes. This makes use of the fact that
@@ -1458,7 +1463,7 @@ private void OpenFile()
1458
1463
#if DEBUG
1459
1464
Log . WriteLine ( _db . _files [ index ] . Name ) ;
1460
1465
#endif
1461
- if ( _db . _files [ index ] . CrcDefined )
1466
+ if ( _db . _files [ index ] . Crc . HasValue )
1462
1467
{
1463
1468
_stream = new CrcCheckStream ( _db . _files [ index ] . Crc . Value ) ;
1464
1469
}
Original file line number Diff line number Diff line change @@ -8,18 +8,13 @@ internal class CFileItem
8
8
{
9
9
public long Size { get ; internal set ; }
10
10
public uint ? Attrib { get ; internal set ; }
11
+ public uint ? ExtendedAttrib { get ; internal set ; }
11
12
public uint ? Crc { get ; internal set ; }
12
13
public string Name { get ; internal set ; }
13
14
14
15
public bool HasStream { get ; internal set ; }
15
16
public bool IsDir { get ; internal set ; }
16
17
17
- public bool CrcDefined => Crc != null ;
18
-
19
- public bool AttribDefined => Attrib != null ;
20
-
21
- public void SetAttrib ( uint attrib ) => Attrib = attrib ;
22
-
23
18
public DateTime ? CTime { get ; internal set ; }
24
19
public DateTime ? ATime { get ; internal set ; }
25
20
public DateTime ? MTime { get ; internal set ; }
Original file line number Diff line number Diff line change @@ -38,5 +38,8 @@ public class SevenZipEntry : Entry
38
38
public override int ? Attrib =>
39
39
FilePart . Header . Attrib . HasValue ? ( int ? ) FilePart . Header . Attrib . Value : null ;
40
40
41
+ public int ? ExtendedAttrib =>
42
+ FilePart . Header . ExtendedAttrib . HasValue ? ( int ? ) FilePart . Header . ExtendedAttrib . Value : null ;
43
+
41
44
internal override IEnumerable < FilePart > Parts => FilePart . AsEnumerable < FilePart > ( ) ;
42
45
}
You can’t perform that action at this time.
0 commit comments