bigfiles: Find the largest files in a directory and its sub-directories

Description Usage Arguments Value Author(s) See Also Examples

Description

This is a function that is useful for identifying large files in a hierarchy of directories. This can recursively process directories and return a data frame with information about the num largest files. One can exclude certain files (including directories) by using pattern matching on the names

Usage

1
bigfiles(dir = ".", recursive = TRUE, num = 50, maxDepth = 10, excludePattern = character(), files = list.files(dir, full.names = TRUE))

Arguments

dir

character, the top-level directory in which to find large files

recursive

a logical value indicating whether to process sub-directories or not.

num

the maximum number of files to return in the result.

maxDepth

a non-negative integer indicating how many sub-directories deep we should process. This is only used when recursive is TRUE.

excludePattern

a regular expression passed to grep to identify files by name that we should exclude. This applies to directories as well as files. Directories that are excluded will not be processed recursively.

files

a character vector naming the top-level files to process. This is typically not specified by the caller. However, one can specify a subset of the files in the top-level directory, e.g. to exclude certain directories (or even files).

Value

A data frame similar to file.info with the largest files.

Author(s)

Duncan Temple Lang

See Also

file.info list.files

Examples

1
2
3
4
5
6
7
## Not run:   
  a = bigfiles("~/Projects/org/omegahat/R", maxDepth = 3, excludePattern = "(tar.gz|tu)$")

## End(Not run)

 big = bigfiles(.libPaths()[1])
 big = bigfiles(R.home())

omegahat/RBigfiles documentation built on May 24, 2019, 1:52 p.m.