This commit is contained in:
pointfeev 2021-12-05 19:33:42 -05:00
parent 9f29bfbe59
commit d73d05c4ee
No known key found for this signature in database
GPG key ID: AA14DC36C4D7D13C

View file

@ -64,17 +64,10 @@ namespace CreamInstaller
public static bool IsFilePathLocked(this string filePath)
{
if (!File.Exists(filePath)) return false;
bool Locked = false;
try
{
File.Open(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None).Close();
}
catch (IOException)
{
Locked = true;
}
return Locked;
try { File.Open(filePath, FileMode.Open, FileAccess.ReadWrite, FileShare.None).Close(); }
catch (FileNotFoundException) { return false; }
catch (IOException) { return true; }
return false;
}
public static SelectForm SelectForm;