add dir_usage, recursive version of dir_stat

This commit is contained in:
Doug MacEachern 2005-12-14 02:56:13 +00:00
parent d695f3de06
commit d50e4efe42
2 changed files with 14 additions and 0 deletions

View File

@ -113,6 +113,8 @@ typedef struct {
sigar_uint64_t disk_usage;
} sigar_dir_stat_t;
typedef sigar_dir_stat_t sigar_dir_usage_t;
SIGAR_DECLARE(const char *)
sigar_file_attrs_type_string_get(sigar_file_type_e type);
@ -133,3 +135,7 @@ sigar_file_attrs_permissions_string_get(sigar_uint64_t permissions,
SIGAR_DECLARE(int) sigar_dir_stat_get(sigar_t *sigar,
const char *dir,
sigar_dir_stat_t *dirstats);
SIGAR_DECLARE(int) sigar_dir_usage_get(sigar_t *sigar,
const char *dir,
sigar_dir_usage_t *dirusage);

View File

@ -711,3 +711,11 @@ SIGAR_DECLARE(int) sigar_dir_stat_get(sigar_t *sigar,
SIGAR_ZERO(dirstats);
return dir_stat_get(sigar, dir, dirstats, 0);
}
SIGAR_DECLARE(int) sigar_dir_usage_get(sigar_t *sigar,
const char *dir,
sigar_dir_usage_t *dirusage)
{
SIGAR_ZERO(dirusage);
return dir_stat_get(sigar, dir, dirusage, 1);
}