Skip to main content

method Deno.FsFile.prototype.tryLock

#FsFile.prototype.tryLock(exclusive?: boolean): Promise<boolean>

Try to acquire an advisory file-system lock for the file. Returns true if the lock was acquired, false if the file is already locked.

Unlike Deno.FsFile.lock, this method will not block if the lock cannot be acquired.

Parameters #

#exclusive: boolean = false
optional

Return Type #

Promise<boolean>

Did you find what you needed?

Privacy policy