Difference between revisions of "File.makedir"
Jump to navigation
Jump to search
m (Changed .delete to .makedir) |
m (Fixed another copy/paste error) |
||
Line 14: | Line 14: | ||
=== Result === | === Result === | ||
− | If the directory was successfully | + | 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. | ||
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"