diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-21 19:13:40 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-21 19:13:40 -0500 |
commit | 46a02444bdeac16474e31c4e836b118c07f8f57f (patch) | |
tree | 3b8079c0e19704c5c0c45ca838c84a35d4ad608c /filesystem.h | |
parent | 8fca7beaf35cfc438d5d29f352f80dd18efe7d2e (diff) |
trying to make clicking on directories work; not done yet
Diffstat (limited to 'filesystem.h')
-rw-r--r-- | filesystem.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/filesystem.h b/filesystem.h index 238ebb1..2e561cd 100644 --- a/filesystem.h +++ b/filesystem.h @@ -16,12 +16,18 @@ bool fs_file_exists(char const *path); // When you're done with the file names, call free on each one, then on the array. // NOTE: The files aren't returned in any particular order! char **fs_list_directory(char const *dirname); -// create the directory specified by `path` -// returns: +// Create the directory specified by `path` +// Returns: // 1 if the directory was created successfully // 0 if the directory already exists // -1 if the path already exists, but it's not a directory, or if there's another error (e.g. don't have permission to create directory). int fs_mkdir(char const *path); +// Puts the current working directory into buf, including a null-terminator, writing at most buflen bytes. +// Returns: +// 1 if the working directory was inserted into buf successfully +// 0 if buf is too short to hold the cwd +// -1 if we can't get the cwd for whatever reason. +int fs_get_cwd(char *buf, size_t buflen); #endif // FILESYSTEM_H_ |