S
S
sanders rocket2022-03-19 22:28:27
JavaScript
sanders rocket, 2022-03-19 22:28:27

How to get file directory?

getFiles('./', function (err, files) {
    for (const item of getDirectories('./')) { // получит все директории
        if (item.startsWith('YT')) { // оставит нужные директории
            for (const item of files) {
                const array = fs.readFileSync(item).toString().split("\n");
                for (const item of array) {
                    let check = item.match(/Account (.+) Subs: (\d+)/)
                    if (check != null || check != undefined) {
                        if (Number(check[2]) > Number(limit[1])) { // ПРОВЕРКА
                            fska.copy('./' + item, './result/' + item, err => { // НУЖНО ПОЛУЧИТЬ  ДИРЕКТОРИЮ ФАЙЛА, КОТОРЫЙ ПРОШЕЛ ПРОВЕРКУ
                                if(err) return console.error(err);
                                console.log('success!');
                            });
                        }
                    }
                }
            }
        }
    }
});

How to get the directory of a file that passed the test?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikcet, 2022-03-20
@Nikcet

It seems this is for you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question