From 117ab90e16c2f636aef8ec9c3d21e574569acc0f Mon Sep 17 00:00:00 2001 From: carsakiller Date: Fri, 20 Sep 2024 22:06:14 -0400 Subject: [PATCH] fix: FS.CreateDirectory return values --- docs/en/scripting/server-reference.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/scripting/server-reference.md b/docs/en/scripting/server-reference.md index eaa43a16..c1a2ee31 100644 --- a/docs/en/scripting/server-reference.md +++ b/docs/en/scripting/server-reference.md @@ -720,13 +720,13 @@ Please always use `/` as a separator when specifying paths, as this is cross-pla Creates the specified directory, and any parent directories if they don't exist. Behavior is roughly equivalent to the common linux command `mkdir -p`. -Returns whether the operation had an error, and, if it *did*, an error message. This means that, if `true` is returned, an error occurred. +If successful, returns `true` and `""`. If creating the directory failed, `false` and an error message (`string`) is returned. Example: ```lua -local error, error_message = FS.CreateDirectory("data/mystuff/somefolder") +local success, error_message = FS.CreateDirectory("data/mystuff/somefolder") -if error then +if not success then print("failed to create directory: " .. error_message) else -- do something with the directory