Skip to content

raylib.ChangeDirectory

JoeStrout edited this page Oct 17, 2026 · 3 revisions

Change working directory, returns 0 on success (nonzero on failure)

Parameters

Parameter Default Value Note
dirPath

Return value

Condition Return Value
(always) number

Notes

Returns 0 on success and nonzero on failure (raylib 6.2 convention). Before raylib 6.2 this returned true (1) on success, so old if raylib.ChangeDirectory(path) then checks are now inverted.

Example

if raylib.ChangeDirectory("/home/user/myproject") == 0 then
    print "Directory changed."
else
    print "Failed to change directory."
end if

Clone this wiki locally