Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close/Unlock won't close the file descriptor if not locked #30

Closed
virtuald opened this issue Sep 17, 2018 · 0 comments · Fixed by #43
Closed

Close/Unlock won't close the file descriptor if not locked #30

virtuald opened this issue Sep 17, 2018 · 0 comments · Fixed by #43
Labels

Comments

@virtuald
Copy link
Contributor

virtuald commented Sep 17, 2018

Went and looked back at this, now I remember why I wanted an extra Close() function.

In try, anywhere after

var retried bool
, an error will leave the file open and the lock will be marked unlocked -- which means Unlock won't clear the file. A similar situation exists with the lock function as well, and the windows implementation suffers the same issue.

Perhaps the best solution would be to just close the file if the lock/try failed, then a user doesn't need to worry so much about a close function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants