txt: ## mkdir.md
  mkdir
  
  Combined from primary sources listed below.
  
  # [In Independent routines](#___top "go to top of document")[§](#(Independent_routines)_sub_mkdir "direct link")
  
  See primary documentation
  [in context](/type/independent-routines#sub_mkdir)
  for **sub mkdir**.
  
  ```raku
  sub    mkdir(IO() $path, Int() $mode = 0o777 --> IO::Path:D)
  ```
  
  Creates a new directory; see [`mode`](/routine/mode) for explanation and valid values for `$mode`. Returns the [`IO::Path`](/type/IO/Path) object pointing to the newly created directory on success; [fails](/routine/fail) with [`X::IO::Mkdir`](/type/X/IO/Mkdir) if directory cannot be created.
  
  Also creates parent directories, as needed (similar to \*nix utility `mkdir` with `-p` option); that is, `mkdir "foo/bar/ber/meow"` will create `foo`, `foo/bar`, and `foo/bar/ber` directories if they do not exist, as well as `foo/bar/ber/meow`.
  
  # [In IO::Path](#___top "go to top of document")[§](#(IO::Path)_method_mkdir "direct link")
  
  See primary documentation
  [in context](/type/IO/Path#method_mkdir)
  for **method mkdir**.
  
  ```raku
  method mkdir(IO::Path:D: Int() $mode = 0o777 --> IO::Path:D)
  ```
  
  Creates a new directory, including its parent directories, as needed (similar to \*nix utility `mkdir` with `-p` option). That is, `mkdir "foo/bar/ber/meow"` will create `foo`, `foo/bar`, and `foo/bar/ber` directories as well if they do not exist.
  
  Returns the `IO::Path` object pointing to the newly created directory on success; [fails](/routine/fail) with [`X::IO::Mkdir`](/type/X/IO/Mkdir) if directory cannot be created.
  
  See also [`mode`](/routine/mode) for explanation and valid values for `$mode`.
  