This commit is contained in:
Igor Pavlov
2016-09-29 00:00:00 +00:00
committed by Kornel Lesiński
parent 1eddf527ca
commit 232ce79574
83 changed files with 1088 additions and 307 deletions

View File

@@ -30,7 +30,14 @@ static const Byte kProps[] =
kpidIsDir,
kpidSize,
kpidPackSize,
kpidMTime
kpidMTime,
// kpidCTime,
// kpidATime,
kpidPosixAttrib,
// kpidUser,
// kpidGroup,
// kpidLinks,
kpidSymLink
};
static const Byte kArcProps[] =
@@ -213,17 +220,87 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
prop = s;
}
break;
case kpidSymLink:
if (_archive.IsSusp)
{
UString s;
UInt32 mode;
if (item.GetPx(_archive.SuspSkipSize, k_Px_Mode, mode))
{
if (((mode >> 12) & 0xF) == 10)
{
AString s8;
if (item.GetSymLink(_archive.SuspSkipSize, s8))
{
s = MultiByteToUnicodeString(s8, CP_OEMCP);
prop = s;
}
}
}
}
break;
case kpidPosixAttrib:
/*
case kpidLinks:
case kpidUser:
case kpidGroup:
*/
{
if (_archive.IsSusp)
{
UInt32 t = 0;
switch (propID)
{
case kpidPosixAttrib: t = k_Px_Mode; break;
/*
case kpidLinks: t = k_Px_Links; break;
case kpidUser: t = k_Px_User; break;
case kpidGroup: t = k_Px_Group; break;
*/
}
UInt32 v;
if (item.GetPx(_archive.SuspSkipSize, t, v))
prop = v;
}
break;
}
case kpidIsDir: prop = item.IsDir(); break;
case kpidSize:
case kpidPackSize:
if (!item.IsDir())
prop = (UInt64)ref.TotalSize;
break;
case kpidMTime:
// case kpidCTime:
// case kpidATime:
{
FILETIME utc;
if (item.DateTime.GetFileTime(utc))
if (/* propID == kpidMTime && */ item.DateTime.GetFileTime(utc))
prop = utc;
/*
else
{
UInt32 t = 0;
switch (propID)
{
case kpidMTime: t = k_Tf_MTime; break;
case kpidCTime: t = k_Tf_CTime; break;
case kpidATime: t = k_Tf_ATime; break;
}
CRecordingDateTime dt;
if (item.GetTf(_archive.SuspSkipSize, t, dt))
{
FILETIME utc;
if (dt.GetFileTime(utc))
prop = utc;
}
}
*/
break;
}
}
@@ -321,8 +398,10 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
UInt64 offset = 0;
for (UInt32 e = 0; e < ref.NumExtents; e++)
{
lps->InSize = lps->OutSize = currentTotalSize + offset;
const CDir &item2 = ref.Dir->_subItems[ref.Index + e];
if (item2.Size == 0)
continue;
lps->InSize = lps->OutSize = currentTotalSize + offset;
RINOK(_stream->Seek((UInt64)item2.ExtentLocation * kBlockSize, STREAM_SEEK_SET, NULL));
streamSpec->Init(item2.Size);
RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress));