Skip to contents

free_disk_gb() returns the free space of the disk holding a path; check_free_disk() stops when it falls below a minimum. Long collections and OCR runs call it regularly: DuckDB writes fail badly on a full disk.

Usage

free_disk_gb(path = ".")

check_free_disk(path = ".", min_gb = getOption("coRpusdb.min_free_gb", 20))

Arguments

path

Character. A path on the disk to check.

min_gb

Number. Minimal free space, in gigabytes.

Value

free_disk_gb(): gigabytes (NA where df is not available). check_free_disk(): the free space, invisibly.

Examples

free_disk_gb(tempdir())
#> [1] 16.19949
check_free_disk(tempdir(), min_gb = 0)