is_dir_empty: Check if a directory is empty

View source: R/is.R

is_dir_emptyR Documentation

Check if a directory is empty

Description

This function checks whether a given directory is empty or not.

Usage

is_dir_empty(path)

Arguments

path

A character string specifying the path to the directory to check.

Value

A logical value. Returns TRUE if the directory is empty, FALSE otherwise.

Examples

## Not run: 
is_dir_empty("path/to/empty/directory")  # Returns TRUE
is_dir_empty("path/to/non-empty/directory")  # Returns FALSE

## End(Not run)


r-lib/fs documentation built on July 4, 2025, 9:24 p.m.