Skip to content

usage of write-file-atomic #183

@mcollina

Description

@mcollina

Writing file atomically is quite important for lock files and things things like that, however it should hardly be needed for all files operation. In the datastore-fs implementation, all files are written using the write-file-atomic module. As you can see in its source code, it does quite a few file system operations.

See https://github.com/ipfs/js-datastore-fs/blob/a6fc16ab4bd4c0b5d4189591057ae45e0d239908/src/index.js#L13 where write-file-atomic is used.

I think the best goal here is to add an option to store.put() to note that if file should be locked or not before usage. The flag could be ignored in other storage systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions