How To Create A Directory If It Does Not Exist

[Solved] How To Create A Directory If It Does Not Exist | Php - Code Explorer | yomemimo.com
Question : How to create a directory, if it does not exist?

Answered by : david-k

const fs = require('fs');
const createDirIfNotExists = dir => (!fs.existsSync(dir) ? fs.mkdirSync(dir) : undefined);
// Example
createDirIfNotExists('test'); // creates the directory 'test', if it doesn't exist

Source : https://dev.to/madza/20-modern-es6-snippets-to-solve-practical-js-problems-3n83 | Last Update : Sat, 08 Oct 22

Question : Create directory if it does not exist

Answered by : defeated-dugong-2sd00afmm5i4

string currentPath = Directory.GetCurrentDirectory();
if (!Directory.Exists(Path.Combine(currentPath, "ACH"))) Directory.CreateDirectory(Path.Combine(currentPath, "ACH"));
//at this point your folder should exist

Source : https://stackoverflow.com/questions/3343206/how-to-create-a-folder-in-the-application-installed-directory | Last Update : Thu, 19 Aug 21

Answers related to how to create a directory if it does not exist

Code Explorer Popular Question For Php