mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-30 12:23:41 +01:00
General formatting and cleanup.
This commit is contained in:
parent
2b46397e8e
commit
12ee42df8e
29 changed files with 289 additions and 197 deletions
|
|
@ -5,13 +5,14 @@ namespace Penumbra.Util
|
|||
{
|
||||
public static class TempFile
|
||||
{
|
||||
public static FileInfo TempFileName( DirectoryInfo baseDir, string suffix = "")
|
||||
public static FileInfo TempFileName( DirectoryInfo baseDir, string suffix = "" )
|
||||
{
|
||||
const uint maxTries = 15;
|
||||
for( var i = 0; i < maxTries; ++i )
|
||||
{
|
||||
var name = Path.GetRandomFileName();
|
||||
var path = new FileInfo( Path.Combine( baseDir.FullName, suffix.Any() ? name.Substring( 0, name.LastIndexOf( '.' ) ) + suffix : name ) );
|
||||
var path = new FileInfo( Path.Combine( baseDir.FullName,
|
||||
suffix.Any() ? name.Substring( 0, name.LastIndexOf( '.' ) ) + suffix : name ) );
|
||||
if( !path.Exists )
|
||||
{
|
||||
return path;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue