Re: [fpc-pascal] (Unix) file locking

2016-06-21 Thread Mark Morgan Lloyd
Björn Lundin wrote: On 2016-06-21 00:37, Fabio Luis Girardi wrote:> > > 2016-06-20 18:15 GMT-03:00 Björn Lundin >:> > > on Linux and AIX I use lockf.> then read() and write() from the os.> However I lock the whole file, but the manpage says it is possib

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Björn Lundin
On 2016-06-21 00:37, Fabio Luis Girardi wrote: > > > 2016-06-20 18:15 GMT-03:00 Björn Lundin >: > > > on Linux and AIX I use lockf. > then read() and write() from the os. > However I lock the whole file, but the manpage says it is possible to > lock

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Fabio Luis Girardi
2016-06-20 18:15 GMT-03:00 Björn Lundin : > > > on Linux and AIX I use lockf. > then read() and write() from the os. > However I lock the whole file, but the manpage says it is possible to > lock parts of it. > > > This can be used to lock character devices, like /dev/ttyUSB0? FPC fpFLock does the

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Björn Lundin
On 2016-06-20 11:28, Mark Morgan Lloyd wrote: > I'm approaching a situation where up to four identical processes will be > reading and writing the same files. There will be process-level > synchronisation which should prevent clashes, but I'd still like to add > locking at the file level. > > I pr

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Mark Morgan Lloyd
Jonas Maebe wrote: On 20/06/16 11:28, Mark Morgan Lloyd wrote: I'm approaching a situation where up to four identical processes will be reading and writing the same files. There will be process-level synchronisation which should prevent clashes, but I'd still like to add locking at the file leve

Re: [fpc-pascal] (Unix) file locking

2016-06-20 Thread Jonas Maebe
On 20/06/16 11:28, Mark Morgan Lloyd wrote: I'm approaching a situation where up to four identical processes will be reading and writing the same files. There will be process-level synchronisation which should prevent clashes, but I'd still like to add locking at the file level. If you use sysu