aremmell / libsir

The Standard Incident Reporter library: A lightweight, cross-platform library for information distribution.
https://libsir.rml.dev/
MIT License
35 stars 5 forks source link

Add file locking support #185

Open johnsonjh opened 1 year ago

johnsonjh commented 1 year ago

I did this for DPS8M (for all platforms but Windows), and it works well enough:

IMG_7934

My implementation there is over-complicated - it uses three approaches - dotfiles, flock, and fcntl. It also passes status of who holds the lock via the dotfile in case of conflicts over network shares. We don't need anything that complicated here.

aremmell commented 1 year ago

If you want guidance on how to accomplish it on Windows with the native APIs, I can be of assistance.