Lists the files in the current working directory of the cartridge storage area.
Alias for ls.

You execute this system command at the PICO-8 prompt.

Unlike the ls command of some operating systems, this command does not take arguments. To see the contents of a directory (folder) in the cartridge storage area, first use the cd command to change the current working directory, then use ls.

dir is an alias for this command.

This command can also be used by a program as a function: ls() The return value is a table of filenames. This returns the names of files only, and does not return subdirectories.

Examples Edit

At the command prompt:

> cd demos
> ls

In code:

-- get the list of files
files = ls()

See also Edit

Community content is available under CC-BY-SA unless otherwise noted.