unionfs icon indicating copy to clipboard operation
unionfs copied to clipboard

Document on the order of operations on underlay file systems

Open aleung opened this issue 4 years ago • 2 comments

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

aleung avatar Feb 08 '21 08:02 aleung

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

rrthomas avatar May 25 '21 12:05 rrthomas