[fpc-pascal] File locking/protection in Linux

Tony Pelton tpelton at gmail.com
Wed Nov 2 04:16:18 CET 2005


without looking at what the PSP code is doing ...

an article on this subject, specific to file locking on linux ...

http://lists.jammed.com/ISN/2003/06/0104.html

Tony

On 11/1/05, L505 <fpc505 at z505.com> wrote:
> > How can be avoided in Linux the file corruption due to simultaneous write
> > access from two different process?
> > Or how can it be avoided to access the same file by two different process?
> > I experienced a few (but painful) data loss due to this problem, and I'm
> > unable to solve the problem.
>
>
> The Pascal Server Pages project has a unit in it that allows this if you are interested. It
> is not specific to Pascal Server Pages as far as I know.
>
> Basically how it works is a simple time delay is put on the file until it is free again.
> You can check FileShare.pp if you are intersted in a file locking read/write method.
>
> SVN:
> https://opensvn.csie.org/pspcgi/psp-1.5.x-devel/src/fileshare.pp
>
> For documentation on how those units would be used, check:
> http://z505.com/cgi-bin/psp/docs/1.4.1/psp_doc_i.cgi?p=mod.fileshare.html
>
> Again, these units and documentation were written with regards to CGI programming. However,
> file sharing is not specific to cgi programming of course!
>



More information about the fpc-pascal mailing list