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

Document on the order of operations on underlay file systems #556

Open
aleung opened this issue Feb 8, 2021 · 1 comment
Open

Document on the order of operations on underlay file systems #556

aleung opened this issue Feb 8, 2021 · 1 comment

Comments

@aleung
Copy link
Contributor

aleung commented Feb 8, 2021

I thought the unionfs is trying to operate on underlay file systems in the same order as the use, but after tested it I found it's in reversed order.

It's better to be mentioned in the document.

const {Volume} = require('memfs');
const {ufs} = require('unionfs');

const vol1 = Volume.fromJSON({'/test': '1'});
const vol2 = Volume.fromJSON({'/test': '2'});

ufs
    .use(vol1)
    .use(vol2);

console.log(ufs.readFileSync('/test', 'utf8'));  // 2, NOT 1
@rrthomas
Copy link

Thanks for filing this, @aleung, I had exactly the same question!

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

No branches or pull requests

2 participants