Skip to content

Input Output Functions

SpiredMoth edited this page Sep 16, 2019 · 1 revision
char* current_directory();

Returns the directory from which the script was called

  • This must be manually freed
struct directory* read_directory(char* dir);

For reading the files in directory dir.

  • Returns a directory struct
  • To free the directory struct, use delete_directory
void delete_directory(struct directory* dir);

Deletes a directory retrieved via read_directory

struct directory {
    int count;
    char** files;
};