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



[Overview][Procedures and functions] Reference for unit 'fileshare' (#powtils_main)

FileMarkRead

Declaration

Source position: fileshare.pas line 22

function FileMarkRead(

  const fname: String;

  var key: Word

):Boolean;

Notes

Marks a file for reading - use this function when a file is going to be read, with possibility of someone else writing at the same time.

The key parameter returns a key to be used for unlocking the file when done reading. Store the key parameter in a variable and send it to the FileUnmarkRead function when finished reading.

Example

var
  k: word;
begin
  FileMarkRead('test.txt', k);
  // do your reading here, other people wait until it is unlocked
  //...
  FileUnmarkRead('test.txt', k);
  // now it is unlocked
end.






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