The following code:
unionfs = require('unionfs')
ufs = unionfs.ufs
fs = require('fs')
ufs.use(fs)
fsMonkey = require('fs-monkey')
patchFs = fsMonkey.patchFs
patchFs(ufs)
fs.readdirSync('/')
gives the error:
…/node_modules/unionfs/lib/union.js:346
throw err;
^
RangeError: Maximum call stack size exceeded
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:334:38)
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79)
at Union.readdirSync (/home/rrt/Software/nancy/node_modules/unionfs/lib/union.js:329:79) {
prev: null
}
I presume the problem arises because fs is patched to use ufs, but that in turn is using fs? But the new fs should use ufs, while ufs should use the old fs? I guess that this sort of patching is quite fiddly and so there may be a gotcha here…
Thanks for fs-monkey!
The following code:
gives the error:
I presume the problem arises because
fsis patched to useufs, but that in turn is usingfs? But the newfsshould useufs, whileufsshould use the oldfs? I guess that this sort of patching is quite fiddly and so there may be a gotcha here…Thanks for
fs-monkey!