Hi Tim, Am 16.12.2015 um 10:52 schrieb Tim Ruehsen <[email protected]>: > On Wednesday 16 December 2015 10:31:33 Giuseppe Scrivano wrote: >> the gnulib documentation for flock says: >> >> Portability problems not fixed by Gnulib: >> >> This function is missing on some platforms: >> AIX 5.1, HP-UX 11.23, Solaris 11 2011-11, BeOS. >> >> This can either be because nobody cared before, or because there is no >> way to emulate it on these platforms. >> >> Couldn't we replace the flock part with a write to a tmp file+atomic >> rename? In the remote case of two wget processes trying to write the >> same file, at least we won't get garbage there. What do you think? > > There is no atomic rename for all OSes, AFAIK. > > How about using fcntl() for locking ? The gnulib emulation might be better and > it is a POSIX function.
This is the suggested workaround on Solaris and also more POSIX-compliant: http://www.perkin.org.uk/posts/solaris-portability-flock.html Best regards — Dago -- "You don't become great by trying to be great, you become great by wanting to do something, and then doing it so hard that you become great in the process." - xkcd #896
signature.asc
Description: Message signed with OpenPGP using GPGMail
