Executing the below function test () with Node.js v8.11.2 on my Windows-10 prints out this:
DOES NOT EXIST ? C:\pagefile.sys
DOES NOT EXIST ? C:\hiberfil.sys
DOES NOT EXIST ? C:\swapfile.sys
DOES NOT EXIST ? C:\System Volume Information
These all seem to be invisible system files yes.
But they obviously exist. So why does Node.js tell me they don't exist? Are there other cases where file or folder is listed by readdirSync() yet existsSync() returns false for them?
Is this a feature or bug?
function test ()
{ let Fs = require("fs");
let Path = require("path");
let path = "C:/";
let ents = Fs.readdirSync(path) ;
let dirs = ents.map
( e =>
{ let absPath = Path.join (path, e);
if (! Fs.existsSync(absPath))
{ console.log ("DOES NOT EXIST ? " + absPath)
} else
{ console.log ("DOES EXIST: " + absPath)
}
}
);
}