Add debug display for ResidentResources.

This commit is contained in:
Ottermandias 2022-03-20 16:21:14 +01:00
parent ad55d178d4
commit 98b4b29ff5
8 changed files with 59 additions and 102 deletions

View file

@ -12,7 +12,7 @@ public static class TempFile
{
var name = Path.GetRandomFileName();
var path = new FileInfo( Path.Combine( baseDir.FullName,
suffix.Any() ? name.Substring( 0, name.LastIndexOf( '.' ) ) + suffix : name ) );
suffix.Length > 0 ? name[ ..name.LastIndexOf( '.' ) ] + suffix : name ) );
if( !path.Exists )
{
return path;
@ -21,13 +21,4 @@ public static class TempFile
throw new IOException();
}
public static FileInfo WriteNew( DirectoryInfo baseDir, byte[] data, string suffix = "" )
{
var fileName = TempFileName( baseDir, suffix );
using var stream = fileName.OpenWrite();
stream.Write( data, 0, data.Length );
fileName.Refresh();
return fileName;
}
}