Table of Contents

Class NativeLockFile

Namespace
Stride.Core.IO
Assembly
Stride.Core.IO.dll
public static class NativeLockFile
Inheritance
object
NativeLockFile

Methods

TryAcquireFile(FileStream, long, long, bool)

Non-blocking lock acquisition that classifies failure for retry decisions.

public static NativeLockFile.FileLockResult TryAcquireFile(FileStream fileStream, long offset, long count, bool exclusive)

Parameters

fileStream FileStream
offset long
count long
exclusive bool

Returns

NativeLockFile.FileLockResult

TryLockFile(FileStream, long, long, bool, bool)

Attempts to lock a byte range of a file.

public static bool TryLockFile(FileStream fileStream, long offset, long count, bool exclusive, bool failImmediately = false)

Parameters

fileStream FileStream
offset long
count long
exclusive bool
failImmediately bool

Returns

bool

true if the lock was acquired, false if the lock could not be acquired.

TryUnlockFile(FileStream, long, long)

Unlocks a byte range of a file previously locked with TryLockFile(FileStream, long, long, bool, bool).

public static void TryUnlockFile(FileStream fileStream, long offset, long count)

Parameters

fileStream FileStream
offset long
count long