method
mkdir
![Wide documentation Importance_3](https://d2vfyqvduarcvs.cloudfront.net/images/importance_3.png?1349367920)
mkdir(p1, p2 = v2)
public
Makes a new directory named by string, with permissions specified by the optional parameter anInteger. The permissions may be modified by the value of File::umask, and are ignored on NT. Raises a SystemCallError if the directory cannot be created. See also the discussion of permissions in the class documentation for File.
Dir.mkdir(File.join(Dir.home, ".foo"), 0700) #=> 0
Register or
log in
to add new notes.
allen -
March 3, 2010 - (>= v1_8_6_287)
leente -
November 23, 2009
![Default_avatar_30](https://www.gravatar.com/avatar/bde02640093c9b75381f772c159574d6?default=http://apidock.com/images/default_avatar_30.png&size=30)
4 thanks
makedirs(path) to create file path
mkdir will only create a single directory on an existing path. If you want to create a full path, like the `mkdir -p /full/path` command, use the makedirs method.
1.8: File.makedirs(path) 1.9: FileUtils.makedirs(path)
![Default_avatar_30](https://www.gravatar.com/avatar/ac95d8758026b818881ed564fd5bb9bb?default=http://apidock.com/images/default_avatar_30.png&size=30)
3 thanks