diff options
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/system.c | 11 | ||||
| -rw-r--r-- | src/base/system.h | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/base/system.c b/src/base/system.c index bf0c6aa9..a7eb205d 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -999,6 +999,17 @@ int fs_chdir(const char *path) return 1; } +char *fs_getcwd(char *buffer, int buffer_size) +{ + if(buffer == 0) + return 0; +#if defined(CONF_FAMILY_WINDOWS) + return _getcwd(buffer, buffer_size); +#else + return getcwd(buffer, buffer_size); +#endif +} + int fs_parent_dir(char *path) { char *parent = 0; diff --git a/src/base/system.h b/src/base/system.h index 2aca4de1..b3beb056 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -994,6 +994,15 @@ int fs_is_dir(const char *path); int fs_chdir(const char *path); /* + Function: fs_getcwd + Gets the current working directory. + + Returns: + Returns a pointer to the buffer on success, 0 on failure. +*/ +char *fs_getcwd(char *buffer, int buffer_size); + +/* Function: fs_parent_dir Get the parent directory of a directory |