Does .NET Standard normalize HResult values across every platform it supports?
问题 I am creating a simple function that creates a random file. To be thread safe, it creates the file in a retry loop and if the file exists it tries again. while (true) { fileName = NewTempFileName(prefix, suffix, directory); if (File.Exists(fileName)) { continue; } try { // Create the file, and close it immediately using (var stream = new FileStream(fileName, FileMode.CreateNew, FileAccess.Write, FileShare.Read)) { break; } } catch (IOException e) { // If the error was because the file exists,