Closed popod closed 6 years ago
Your example code does not works in my Mac (High Sierra and node v8.6.0):
var Opened = require('@ronomon/opened'); var paths = ['./test.txt']; Opened.files(paths, function(error, hashTable) { if (error) throw error; paths.forEach( function(path) { console.log(path + ' open=' + hashTable.hasOwnProperty(path)); } ); } );
hashTable contain { 'test.txt': true|false } so you should use:
hashTable
{ 'test.txt': true|false }
console.log(path + ' open=' + hashTable[path]);
In place of:
console.log(path + ' open=' + hashTable.hasOwnProperty(path));
I've too:
.file()
.files()
Thanks @popod, I did another PR quickly with all your fixes but I didn't want to expose Open.file() in the docs just yet.
Thanks for spotting this, I don't know how I missed it.
Your example code does not works in my Mac (High Sierra and node v8.6.0):
hashTable
contain{ 'test.txt': true|false }
so you should use:In place of:
I've too:
.file()
or.files()
..file()
on Unix systems