Volt

makefolder

Creates a new folder.

Syntax

makefolder(path: string) -> void

Parameters

ParameterTypeDescription
pathstringThe folder path to create

Returns

This function does not return a value.

Description

makefolder creates a new folder at the specified path. Parent folders are created automatically if they don't exist.

Example

-- Create a simple folder
makefolder("configs")

-- Create nested folders
makefolder("data/saves/player1")

-- Verify they exist
print(isfolder("configs"))           -- true
print(isfolder("data/saves/player1")) -- true

Ensure Folder Exists

local function ensureFolder(path)
    if not isfolder(path) then
        makefolder(path)
        return true -- Created
    end
    return false -- Already existed
end

if ensureFolder("logs") then
    print("Created logs folder")
end

On this page