(trunk) first draft of changing the FreeSpace API to behave as https://trac.transmissionbt.com/ticket/4076#comment:25 -- libT, rpc, qt, and gtk implementations.

This commit is contained in:
Jordan Lee
2013-02-09 04:05:03 +00:00
parent 794a0c1d80
commit cd09204a6e
31 changed files with 552 additions and 190 deletions

View File

@@ -420,6 +420,27 @@ tr_fileExists (const char * filename, time_t * mtime)
return ok;
}
int64_t
tr_getDirFreeSpace (const char * dir)
{
int64_t free_space;
if (!dir || !*dir)
{
errno = EINVAL;
free_space = -1;
}
else
{
struct tr_device_info * info;
info = tr_device_info_create (dir);
free_space = tr_device_info_get_free_space (info);
tr_device_info_free (info);
}
return free_space;
}
/****
*****
****/