mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Support ancient .NET in FileTypes
This commit is contained in:
@@ -91,7 +91,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
zr = zf.ZipFileOpenReadStream(i, false, out Stream? readStream, out ulong streamsize, out ushort cm);
|
||||
|
||||
// Create the rest of the path, if needed
|
||||
if (!string.IsNullOrWhiteSpace(Path.GetDirectoryName(zf.GetLocalFile(i).Filename)))
|
||||
if (!string.IsNullOrEmpty(Path.GetDirectoryName(zf.GetLocalFile(i).Filename)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.Combine(outDir, Path.GetDirectoryName(zf.GetLocalFile(i).Filename)!));
|
||||
}
|
||||
@@ -450,7 +450,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
ulong istreamSize = (ulong)(inputStream.Length);
|
||||
|
||||
DateTime dt = DateTime.Now;
|
||||
if (UseDates && !string.IsNullOrWhiteSpace(baseFile.Date) && DateTime.TryParse(baseFile.Date.Replace('\\', '/'), out dt))
|
||||
if (UseDates && !string.IsNullOrEmpty(baseFile.Date) && DateTime.TryParse(baseFile.Date.Replace('\\', '/'), out dt))
|
||||
{
|
||||
long msDosDateTime = DateTimeHelper.ConvertToMsDosTimeFormat(dt);
|
||||
TimeStamps ts = new() { ModTime = msDosDateTime };
|
||||
@@ -524,7 +524,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
ulong istreamSize = (ulong)(inputStream.Length);
|
||||
|
||||
DateTime dt = DateTime.Now;
|
||||
if (UseDates && !string.IsNullOrWhiteSpace(baseFile.Date) && DateTime.TryParse(baseFile.Date.Replace('\\', '/'), out dt))
|
||||
if (UseDates && !string.IsNullOrEmpty(baseFile.Date) && DateTime.TryParse(baseFile.Date.Replace('\\', '/'), out dt))
|
||||
{
|
||||
long msDosDateTime = DateTimeHelper.ConvertToMsDosTimeFormat(dt);
|
||||
TimeStamps ts = new() { ModTime = msDosDateTime };
|
||||
@@ -666,7 +666,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
ulong istreamSize = (ulong)(new FileInfo(inputFiles[index]).Length);
|
||||
|
||||
DateTime dt = DateTime.Now;
|
||||
if (UseDates && !string.IsNullOrWhiteSpace(baseFiles[index].Date) && DateTime.TryParse(baseFiles[index].Date?.Replace('\\', '/'), out dt))
|
||||
if (UseDates && !string.IsNullOrEmpty(baseFiles[index].Date) && DateTime.TryParse(baseFiles[index].Date?.Replace('\\', '/'), out dt))
|
||||
{
|
||||
long msDosDateTime = DateTimeHelper.ConvertToMsDosTimeFormat(dt);
|
||||
TimeStamps ts = new() { ModTime = msDosDateTime };
|
||||
@@ -750,7 +750,7 @@ namespace SabreTools.FileTypes.Archives
|
||||
ulong istreamSize = (ulong)(new FileInfo(inputFiles[-index - 1]).Length);
|
||||
|
||||
DateTime dt = DateTime.Now;
|
||||
if (UseDates && !string.IsNullOrWhiteSpace(baseFiles[-index - 1].Date) && DateTime.TryParse(baseFiles[-index - 1].Date?.Replace('\\', '/'), out dt))
|
||||
if (UseDates && !string.IsNullOrEmpty(baseFiles[-index - 1].Date) && DateTime.TryParse(baseFiles[-index - 1].Date?.Replace('\\', '/'), out dt))
|
||||
{
|
||||
long msDosDateTime = DateTimeHelper.ConvertToMsDosTimeFormat(dt);
|
||||
TimeStamps ts = new() { ModTime = msDosDateTime };
|
||||
|
||||
Reference in New Issue
Block a user