createDirSync static method

Result<(), IoError> createDirSync(
  1. Path path
)

Creates the directory if it doesn't exist. Does not create intermediate directories if they do not exist - see Fs.createDirAll.

Returns a Ok if the directory was created. Otherwise, if the directory cannot be created the future completes with an Err of IoError.

Implementation

static Result<(), IoError> createDirSync(Path path) {
  return Fs.ioGuardSync(() => Directory(path.asString()).create())
      .map((_) => ());
}