Skip to content

Permissions support #1009

@wilcoxmd

Description

@wilcoxmd

Hi! What level of support does memfs have for permissions today?

I'm migrating from mock-fs, which allowed me to create read-only files in tests with something like

mockFs({
  fileName: mockFs.file({ mode: 0o444 }); 
})

In memfs, it seems the read-only permissions aren't respected, i.e. this doesn't throw an error like I'd expect:

vol.fromJSON({
  fileName: 'some existing content',
});

vol.chmodSync('fileName', 0o444);
vol.writeFileSync('fileName', 'new content'); // doesn't throw

Should I expect this to work, or perhaps am I doing something incorrect?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions