disk_info.h File Reference

Query disk space properties. More...

#include "int_sizes.h"
#include <time.h>

Go to the source code of this file.

Functions

int disk_info_get (const char *path, UINT64_T *avail, UINT64_T *total)
 Get the total and available space on a disk.
int check_disk_workspace (char *workspace, int64_t *workspace_usage, int force, int64_t manual_disk_option, int measure_wd_interval, time_t last_cwd_measure_time, int64_t last_workspace_usage, UINT64_T disk_avail_threshold)
 Return whether a file will fit in the given directory.
int check_disk_space_for_filesize (char *path, INT64_T file_size, UINT64_T disk_avail_threshold)
 Return whether a file will fit in the given directory.

Detailed Description

Query disk space properties.


Function Documentation

int disk_info_get ( const char *  path,
UINT64_T *  avail,
UINT64_T *  total 
)

Get the total and available space on a disk.

Parameters:
path A filename on the disk to be examined.
avail A pointer to an integer that will be filled with the available space in bytes.
total A pointer to an integer that will be filled with the total space in bytes.
Returns:
Greater than or equal to zero on success, less than zero otherwise.
int check_disk_workspace ( char *  workspace,
int64_t *  workspace_usage,
int  force,
int64_t  manual_disk_option,
int  measure_wd_interval,
time_t  last_cwd_measure_time,
int64_t  last_workspace_usage,
UINT64_T  disk_avail_threshold 
)

Return whether a file will fit in the given directory.

Parameters:
workspace_usage A pointer to an integer that will be filled with the workspace usage.
force An integer that describes if the action is to be forced.
manual_disk_option An integer that describes static manual_disk_option in worker.
measure_wq_interval An integer that describes how often the cwd should be rechecked.
last_cwd_measure_time An time value that describes how recently cwd was checked.
last_workspace_usage An integer that describes previous reading from check_disk_workspace.
disk_avail_threshold An unsigned integer that describes the lowest amount of free space to be left.
Returns:
Zero if the file will not fit, one if the file fits.
int check_disk_space_for_filesize ( char *  path,
INT64_T  file_size,
UINT64_T  disk_avail_threshold 
)

Return whether a file will fit in the given directory.

Parameters:
path A filename of the disk to be measured.
file_size An integer that describes how large the incoming file is.
disk_avail_threshold An unsigned integer that describes the minimum available space to leave.
Returns:
Zero if the file will not fit, one if the file fits.

Generated on 24 Jun 2015 for cctools by  doxygen 1.6.1