MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / IsFileInUse

Method IsFileInUse

loader/Main/Utils.cs:13–27  ·  view source on GitHub ↗
(string path)

Source from the content-addressed store, hash-verified

11 public static void OpenLink(string url) => Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
12
13 public static bool IsFileInUse(string path)
14 {
15 if (!File.Exists(path)) return false;
16
17 try
18 {
19 using (new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None)) { }
20 }
21 catch
22 {
23 return true;
24 }
25
26 return false;
27 }
28
29 public static void DeletePath(string path, bool isDir = false)
30 {

Callers 1

ModuleClass · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected