cloud_prep_ls: Prepare ls output

View source: R/common.R

cloud_prep_lsR Documentation

Prepare ls output

Description

Under the hood all ls functions (s3, drive, local) obtain information about folder content recursively regardless of recursive parameter. This is needed to be able to calculate last modified time and size for folders in case if recursive is set to FALSE. The content is presented in a form of a dataframe similar to what you'd see if you run an ls function with recursive = TRUE and full_names = FALSE.

This function takes such a dataframe from this point and:

  1. Summarizes it to non-recursive output if recursive is FALSE.

  2. Appends path to names if full_names is TRUE.

  3. Writes full names to names of the name column regardless of the full_names parameter.

  4. Evaluates the type column.

Usage

cloud_prep_ls(data, path, recursive, full_names)

Arguments

data

ls dataframe assembled internally by a cloud_ls_* function

path

path that was used in a cloud_ls_* function

recursive

(logical) If TRUE, lists contents recursively in all nested subfolders. Default is FALSE.

full_names

(logical) If TRUE, folder path is appended to object names to give a relative file path.

Value

Transformed data.


cloudfs documentation built on May 29, 2024, 11:08 a.m.