read-dir <dir id> to <name> \ [ type <type> ] \ [ status <status> ]Copied!
begin-handler /dir public // Get the directory where program is started (for command line execution) get-sys directory to cdir // Open directory for reading open-dir cdir dir-id d start-loop // Obtain the next directory entry read-dir d to e status s type t if-true s not-equal RIM_OKAY break-loop end-if if-true t not-equal RIM_UNKNOWN // Display type if-true t equal RIM_FILE print-out "File: " else-if t equal RIM_DIR print-out "Dir: " else-if print-out "Other:" end-if end-if // Display file/directory name print-out e new-line end-loop close-dir d end-handlerCopied!