Filesystem
Store settings and other script data in the Kawaii workspace. Read or replace file contents, append logs, and manage folders using workspace-relative paths.
Functions
appendfileAdd a string after the existing contents of a workspace file. Use it for log entries or other data that accumulates over time. The existing file stays intact before the new bytes. Include a newline in each entry if you want a line-oriented log.
delfileRemove a file from the workspace, such as a temporary export or an outdated settings file. A path that is already missing is ignored. Use isfile or listfiles when selecting the file to remove. The operation deletes stored contents rather than moving them to a temporary trash location.
delfolderRemove a workspace folder and everything inside it, including nested folders. A missing folder is ignored. Use it to clean up a dedicated temporary directory. It removes the entire directory tree, so select a folder owned by that cleanup operation.
dofileExecutes the loaded chunk and discards all chunk return values.
getcustomassetTurn a local file into a content ID that Roblox content properties can use. Kawaii copies the file into its local asset store and returns an rbxasset:// URI. Use it for a local image or other asset assigned to a Roblox content property. For a Drawing Image, assign file bytes to Data instead of this content ID.
isfileCheck whether a workspace path points to an existing file. Use it before reading optional data or to distinguish files from folders in a directory listing. A false result means the path is not an accessible file under the workspace rules; it is not a detailed explanation of why access failed.
isfolderCheck whether a workspace path points to an existing folder. This is useful before listing a directory or when separating folders from files. Use listfiles after this check when you need the folder contents. A path pointing to a file is false even if that file exists.
listfilesGet the files and folders directly inside a workspace directory. Each result is a workspace-relative path that can be passed to the other file functions. Use it to build a file chooser or process one directory. This is an immediate-child listing, so walk returned folders separately for a recursive traversal.
loadfileReturns a compiled chunk; filesystem failures raise.
makefolderCreate a folder for organizing workspace files. Existing folders are kept, and missing parent folders are created along with the requested folder. Use separate directories for related settings, cached images, and exports so later listing or cleanup can target one collection.
readfileRead a workspace file and return its contents as a string. The file is read as bytes, so the same function works for saved text, images, and other binary data. Use it to load saved settings or inspect a local data file. When a file is optional, check isfile first; a missing file raises an error.
writefileSave a string to a workspace file. A new file is created when necessary; writing an existing file replaces all of its previous contents. Use it to save a complete settings document or export. Serialize tables first, since this function stores bytes rather than Luau values.