Create Directory

From SwiftAPI

Jump to: navigation, search

Contents

Java

J2SE 1.4.2

java.io.File : public boolean mkdir()
import java.io.File;
String path = "/tmp/test";
boolean success = new File(path).mkdir();

Perl

perldoc

mkdir FILENAME,MASK
mkdir FILENAME
mkdir
$path = '/tmp/test';
$success = mkdir($path);

PHP

php.net

bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] )
$path = '/tmp/test';
$success = mkdir($path);

Python

docs.python.org

os.mkdir(path[, mode])
import os
path = '/tmp/test'
os.mkdir(path)

Ruby

ruby-doc.org

Dir.mkdir( string [, integer] ) => 0
path = '/tmp/test'
Dir.mkdir(path)
Personal tools