AdvancedLauncher.SDK.Management.FileSystemManager.IsFileLocked C# (CSharp) Method

IsFileLocked() public static method

Checks access to file
public static IsFileLocked ( string file ) : bool
file string Full path to file
return bool
        public static bool IsFileLocked(string file)
        {
            FileStream stream = null;

            try {
                stream = File.Open(file, FileMode.Open, FileAccess.ReadWrite, FileShare.None);
            } catch (IOException) {
                return true;
            } finally {
                if (stream != null) {
                    stream.Close();
                }
            }
            return false;
        }