Closed theory closed 6 years ago
Wrong branch.
@theory FWIW, I wouldn't be against adding a New(*os.File)
function.
Hrm. I've been working on a project where I need to know if a file exists before I try to lock it. And if it doesn't exist, I don't want it created, which is what Flock does (os.O_CREATE|os.O_WRONLY
).
I can think of three other ways to do this:
GetFile()
), but I can appreciate that one might not want to provide a potential footgun.LOCKING IS HARD!
I'm not wed to the name, but do want to have more control over the creation of the file handle.