Being new to this, I'm not sure of the expected behaviour. I'm running node 0.10.15 on Windows and q-io 1.10.3.
If dst is writable, then everything works as expected. If, however, dst is readonly:
1. copy is completely silent - no message is output. The dst file is not affected. I would expect an error.
qfs.copy(src, dst)
.then(function () {
console.log('copied file');
})
.catch(function (err) {
console.error(err);
})
.finally(function () {
console.log('copy finalized');
})
.done();
2. open reports success ('opened file' and 'open finalized') - I would have though "w" would result in an error
qfs.open(dst, {flags: "wb"})
.then(function () {
console.log('opened file');
})
.catch(function (err) {
console.error(err);
})
.finally(function () {
console.log('open finalized');
})
.done();
3. write, in contrast, works as I expect - it generates an error and calls finally
qfs.write(dst, 'hello')
.then(function () {
console.log('written file');
})
.catch(function (err) {
console.error(err);
})
.finally(function () {
console.log('write finalized');
})
.done();
thanks