Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
list_dir.c File Reference

Implements OP_OS_LIST_DIR to list entries in a directory. More...

Go to the source code of this file.

Functions

 free_value (pathv)
 if (path)
 push_value (vm, arr)

Variables

case OP_OS_LIST_DIR
char * path = value_to_string_alloc(&pathv)
Value arr = make_array_from_values(NULL, 0)
 break

Detailed Description

Implements OP_OS_LIST_DIR to list entries in a directory.

Behavior:

  • Pops a path (string); pushes an array of file/directory names as strings.
  • Implementation may delegate to a platform command (e.g., ls -1) for portability.

Errors:

  • Non-string path results in empty array; platform errors also yield an empty array.

Definition in file list_dir.c.

Function Documentation

◆ free_value()

free_value(pathv)

◆ if()

if(path)

Definition at line 29 of file list_dir.c.

Here is the call graph for this function:

◆ push_value()

push_value(vm,
arr )

Variable Documentation

◆ arr

Definition at line 28 of file list_dir.c.

◆ break

break

Definition at line 58 of file list_dir.c.

◆ OP_OS_LIST_DIR

case OP_OS_LIST_DIR

Definition at line 22 of file list_dir.c.

◆ path

Definition at line 25 of file list_dir.c.