const fs = require('fs').promises;
const constants = require('fs').constants;
// fs.access('필수',option)
fs.readdir('./').then((dir) => {
console.log('dir: ', dir);
fs.access('ws_1.txt', constants.F_OK | constants.W_OK | constants.R_OK)
.then(() => {
return fs.unlink('ws_1.txt');
})
.catch((err) => {
console.log('no file exists');
throw err;
});
fs.access('./folder', constants.F_OK | constants.W_OK | constants.R_OK).catch(
(err) => {
throw err;
}
);
});