mirror of
https://github.com/C9Glax/tranga.git
synced 2025-01-12 11:27:32 +01:00
GlobalBase static is FileInUse
This commit is contained in:
parent
e2adac937a
commit
a8697a14a3
@ -102,7 +102,9 @@ public abstract class GlobalBase
|
||||
File.WriteAllText(settings.libraryConnectorsFilePath, JsonConvert.SerializeObject(libraryConnectors));
|
||||
}
|
||||
|
||||
protected bool IsFileInUse(string filePath)
|
||||
protected bool IsFileInUse(string filePath) => IsFileInUse(filePath, this.logger);
|
||||
|
||||
public static bool IsFileInUse(string filePath, Logger? logger)
|
||||
{
|
||||
if (!File.Exists(filePath))
|
||||
return false;
|
||||
@ -114,7 +116,7 @@ public abstract class GlobalBase
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
Log($"File is in use {filePath}");
|
||||
logger?.WriteLine($"File is in use {filePath}");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user