dir_files: Simple summary of files in a directory

View source: R/dir_contents.R

dir_filesR Documentation

Simple summary of files in a directory

Description

Similar to fs::dir_info() but only files, not sub-directories are included, and with fewer columns in the output. Unlike fs::dir_info(), dir must be length one.

Usage

dir_files(dir = ".", ..., shorten = TRUE)

Arguments

dir

Character. A single directory path.

...

Additional arguments passed to dir_info().

shorten

If TRUE (default), the directory column gives the path relative to dir (a "." is given when the directory is dir). If FALSE, the full path is given.

Value

A data frame with columns as follows.

file_name

The name of the file, as a character vector.

ext

The extension of the file, as a character vector.

size

The file size as an fs_bytes vector.

mod_time

The date and time when the file was last modified.

directory

The directory part of the file path, as a fs::path vector.

level

The level of the directory relative to dir

.


jedwards24/edwards documentation built on Sept. 2, 2023, 8:16 a.m.