You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
When I was searching for how to lock a file in GoLang it appears there are OS specific ways of doing it such as calling OS specific file locking mechanisms. Is there a better way that is not operating system specific? i.e. libraries that lock files cross platform without resorting to lower level operating system API calls?
Any plans to do this, or has someone already written something on Github that wraps the lower level locking calls into a library?
Otherwise I'm going to have to use lockfile on unix and windows api calls on MS Windows?
Example of what I mean by file locking: 10 different people access the same file simutaneously. This is bad. So you lock the file and each person gets their turn. Since there is no cross platform file locking (AFAIK) this means using a database instead, is tempting, since the database does the work for you - however I would like to write to files and avoid database for a simple program.
Tamás Gulácsi
unread,
Feb 11, 2016, 12:34:18 AM2/11/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message