Add total disk space to free-space RPC request (#1682)

* Add total space to free-space endpoint

* Update docs
This commit is contained in:
Johan
2021-10-14 20:07:16 +03:00
committed by GitHub
parent ab82e155be
commit 04f8b82308
7 changed files with 89 additions and 62 deletions

View File

@@ -27,6 +27,8 @@ struct timeval;
struct tr_error;
struct tr_disk_space;
/**
* @addtogroup utils Utilities
* @{
@@ -79,10 +81,10 @@ uint8_t* tr_loadFile(char const* filename, size_t* size, struct tr_error** error
char* tr_buildPath(char const* first_element, ...) TR_GNUC_NULL_TERMINATED TR_GNUC_MALLOC;
/**
* @brief Get available disk space (in bytes) for the specified folder.
* @return zero or positive integer on success, -1 in case of error.
* @brief Get disk capacity and free disk space (in bytes) for the specified folder.
* @return struct with free and total as zero or positive integer on success, -1 in case of error.
*/
int64_t tr_getDirFreeSpace(char const* path);
struct tr_disk_space tr_getDirSpace(char const* path);
/**
* @brief Convenience wrapper around timer_add() to have a timer wake up in a number of seconds and microseconds