yast/yast-yast2

View on GitHub
library/general/src/scrconf/system_freespace.scr

Summary

Maintainability
Test Coverage
/**
 * File:
 *    cfg_freespace.scr
 *
 * Summary:
 *    Agent for getting the free space in the directory (in 1K blocks)
 *
 * Author:
 *    Lukas Ocilka <locilka@suse.cz>
 *
 * Access:
 *    read
 *
 * Example:
 *    Read(.system.freespace, "/tmp")
 *    (3752236)
 *
 *    Read(.system.freespace, "/abcd1")
 *    (-1) // Directory does not exist or is not a directory
 *
 *    Read(.system.freespace, "/abcd2")
 *    (-1) // Cannot find '/bin/df' binary
 *
 * Description:
 *     Agent calls command '/bin/df $directory' and returns the available space
 *     in 1K blocks. -1 is returned in case of any error, such as 'Directory does
 *     not exist', 'Object is not a directory', '/bin/df does not exist on the
 *     system' or 'Directory not defined'. Every error should appear in the y2log.
 *
 * $Id$
 *
 */
.system.freespace

`ag_freespace ()