Skip to content

Commit

Permalink
don't set LastWriteTime when extracting zip files on Android, as it m…
Browse files Browse the repository at this point in the history
…ight not be supported and throw, fixes dotnet#35374
  • Loading branch information
adamsitnik committed Jul 27, 2021
1 parent 1a84b29 commit fd7e468
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ public static void ExtractToFile(this ZipArchiveEntry source, string destination
ExtractExternalAttributes(fs, source);
}

File.SetLastWriteTime(destinationFileName, source.LastWriteTime.DateTime);
if (!OperatingSystem.IsAndroid()) // https://github.com/dotnet/runtime/issues/35374, https://github.com/mono/mono/issues/17133
{
File.SetLastWriteTime(destinationFileName, source.LastWriteTime.DateTime);
}
}

static partial void ExtractExternalAttributes(FileStream fs, ZipArchiveEntry entry);
Expand Down

0 comments on commit fd7e468

Please sign in to comment.