1

現在、同期している node.js コードで shell.js の mkdir -p を使用しています。'-p' は shell.mkdir で使用され、フル パスでディレクトリを作成しますが、fs.mkdirこれは実行できません。

if(fs.existsSync(archivePath + "\\" + site + "\\" + year)){ // check if site folder exists
    console.log(archivePath + "\\" + site + "\\" + year + " exists");
}
else {
    console.log(archivePath + "\\" + site + "\\" + year + " does not exist... creating full path now");
    shell.mkdir('-p' , archivePath + "\\" + site + "\\" + year + "\\" + missionID);
}

fs.mkdirの非同期性と の再帰性を一度に取得する方法を誰かが知っている場合はshell.mkdir('-p', absolutePath)、私に知らせてください。

4

2 に答える 2