Skip to content

dos_makepath

Dale Fugier edited this page Jul 1, 2026 · 1 revision

Creates a single path, composed of a drive letter, directory path, file name, and file extension.

Syntax

(dos_makepath drive directory filename extension)

Parameters

drive

The letter (A, B, etc.) corresponding to the desired drive and an optional trailing colon (:). The function inserts the colon automatically in the composite path name if it is missing. If drive is an empty string (""), no drive letter and colon appear in the returned path.

directory

The path of directories, not including the drive designator or the actual file name. The trailing slash is optional. Either forward slashes (/) or double-backslashes (\) or both may be used in a single directory argument. If a trailing slash (/ or \) is not specified, it is inserted automatically. If directory is an empty string (""), no slash is inserted in the returned path.

filename

The base file name without any extensions. If filename is an empty string (""), no file name is inserted in the returned path.

extension

The file name extension, with or without a leading period (.). The function inserts the period automatically if it does not appear in extension. If extension is an empty string (""), no period is inserted in the returned path.

Returns

A fully qualified path if successful.

nil on error.

Example

Command: (dos_makepath "C:" "\\Program Files\\AutoCAD 2006" "acad" "exe")
"C:\\Program Files\\AutoCAD 2006\\acad.exe"

Command: (dos_makepath "C:" "\\Program Files\\AutoCAD 2006" "" "")
"C:\\Program Files\\AutoCAD 2006\\"

Clone this wiki locally