Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Directory listing issue

Can anyone explain this issue?

 

This works:

 

import { listDirSync } from "fs";

import * as fs from "fs";


let ascii_read = fs.readFileSync("./resources/me.txt", "ascii");
console.log("ASCII Data: " + ascii_read);

 

 

But this fails in the next line, with: "opendir failed for: "./resources/"


const listDir = listDirSync("./resources/");

 

Author | ch, passion for improvement.

Best Answer
0 Votes
1 REPLY 1

Does anyone know why a read works but directory list fails on the same directory?

Author | ch, passion for improvement.

Best Answer
0 Votes