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



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

FileUnmarkRead

Declaration

Source position: fileshare.pas line 24

function FileUnmarkRead(

  const fname: String;

  key: Word

):Boolean;

Notes

Call this function after calling FileMarkRead when you are done reading a file.

This function is for when you are sharing files among several people at once, or when edit conflicts could occur. An example of when file sharing is needed: if you design wiki that is file system based instead of database driven. Common files are being accessed at once by several people in a wiki, and you would not want files to be overwritten or read at the sime time someone else was writing to the file.

Example

var
  k: word;
begin
  FileMarkRead('filename.ext', k);
  assign(fh, 'filename.ext');
  reset(fh);
  // Some actions
  close(fh);
  FileUnmarkRead('filename.ext', k);
end.






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