help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Procedures and functions][Variables] Reference for unit 'Unix' (#rtl)

fpFlock

Lock a file (advisory lock)

Declaration

Source position: line 0

function fpFlock(

  fd: cint;

  mode: cint

):cint;

function fpFlock(

  var T: text;

  mode: cint

):cint;

function fpFlock(

  var F: file;

  mode: cint

):cint;

Description

FpFLock implements file locking. it sets or removes a lock on the file F. F can be of type Text or File, or it can be a linux filedescriptor (a longint) Mode can be one of the following constants :

LOCK_SH
sets a shared lock.
LOCK_EX
sets an exclusive lock.
LOCK_UN
unlocks the file.
LOCK_NB
This can be OR-ed together with the other. If this is done the application doesn't block when locking.

The function returns zero if successful, a nonzero return value indicates an error.

Errors

Extended error information is returned by the FpGetErrno function:

See also

#rtl.baseunix.FpFcntl

  

File control operations.

FSync

  

Synchronize file's kernel data with disk.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505