8000 Consider supporting filesystem lock mechanisms · Issue #58 · go-ini/ini · GitHub
[go: up one dir, main page]

Skip to content

Consider supporting filesystem lock mechanisms #58

Open

Description

@radeksimko

Obviously concurrent changes to the same ini file are now prevented via sync.RWMutex.
This in-memory lock is totally sufficient for most use cases where user needs some safety checks in the same process, but I found myself in situation where I would find an actual file-lock handy.

e.g. to prevent user from opening the file in their editor and start editing the ini file while a go program (using this library) interacts with it.

I think there may be a way to implement this in a way that it doesn't break cross-platform compatibility - just have it gracefully degrade - on systems that don't support flock.

https://golang.org/pkg/syscall/#Flock

Any thoughts - any reasons why a potential PR would not be accepted?

Activity

  1. unknwon commented on Aug 3, 2016

    @unknwon
    Member

    Seems not much resources can be found about Go flock...

    Not sure how well they work cross-platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureCategorizes as related to a new featurehelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0