Difference between revisions of "File.makedir"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "The <c>file.makedir</c> method creates a new directory on disk. === Arguments === {| class="wikitable" |- ! Parameter Name !! Default Value !! Meaning |- | path || "" ||...")
 
m (Fixed another copy/paste error)
 
(One intermediate revision by one other user not shown)
Line 14: Line 14:
 
=== Result ===
 
=== Result ===
  
If the directory was successfully deleted, this method returns [[true]] (1).
+
If the directory was successfully created, this method returns [[true]] (1).
 
Otherwise, it returns [[false]] (0).  This can happen if the given path is invalid, a file or directory already exists at that location, or any other file-level error occurs.
 
Otherwise, it returns [[false]] (0).  This can happen if the given path is invalid, a file or directory already exists at that location, or any other file-level error occurs.
  
Line 21: Line 21:
 
The following attempts to create a directory called "data" in the [[file.curdir|current directory]].
 
The following attempts to create a directory called "data" in the [[file.curdir|current directory]].
  
<ms>file.delete "data"</ms>
+
<ms>file.makedir "data"</ms>
  
 
[[Category:Mini Micro]]
 
[[Category:Mini Micro]]
 
[[Category:Command-Line MiniScript]]
 
[[Category:Command-Line MiniScript]]

Latest revision as of 00:46, 25 December 2022

The file.makedir method creates a new directory on disk.

Arguments

Parameter Name Default Value Meaning
path "" file name, partial path, or absolute path to directory to be created

If given a file name or partial path, it will be interpreted relative to the current working directory (see file.curdir).

Result

If the directory was successfully created, this method returns true (1). Otherwise, it returns false (0). This can happen if the given path is invalid, a file or directory already exists at that location, or any other file-level error occurs.

Example

The following attempts to create a directory called "data" in the current directory.

file.makedir "data"