Logo

Programming-Idioms

  • Java
  • Clojure
  • Go
  • C#

Idiom #211 Create folder

Create the folder at path on the filesystem

Directory.CreateDirectory(path)
import java.io.File;
boolean ok = new File(path).mkdirs();

May throw a SecurityException
import "os"
err := os.MkdirAll(path, os.ModeDir)

MkdirAll creates any necessary parents.
import "os"
err := os.Mkdir(path, os.ModeDir)

This works only if path's parent already exists.
with Ada.Directories;
Ada.Directories.Create_Directory (New_Directory => Path);

New implementation...
< >
programming-idioms.org