Emul8.Utilities.PosixFileLocker.PosixFileLocker C# (CSharp) Method

PosixFileLocker() public method

public PosixFileLocker ( string fileToLock ) : System
fileToLock string
return System
        public PosixFileLocker(string fileToLock)
        {
            file = fileToLock;
            fd = Syscall.open(fileToLock, OpenFlags.O_CREAT | OpenFlags.O_RDWR, FilePermissions.DEFFILEMODE);
            if(!TryDoFileLocking(fd, true))
            {
                throw new InvalidOperationException("File {0} not locked.".FormatWith(file));
            }
        }