R/file.size.R

Defines functions file.size

Documented in file.size

#' @title Backports of wrappers around \code{file.info} for R < 3.2.0
#' @rdname file.size
#'
#' @description
#' See the original description in \code{base::file.size}.
#'
#' @keywords internal
#' @rawNamespace if (getRversion() < "3.2.0") export(file.size)
#' @examples
#' # get functions from namespace instead of possibly getting
#' # implementations shipped with recent R versions:
#' bp_file.size = getFromNamespace("file.size", "backports")
#' bp_file.mode = getFromNamespace("file.size", "backports")
#' bp_file.mtime = getFromNamespace("file.size", "backports")
#'
#' fn = file.path(R.home(), "COPYING")
#' bp_file.size(fn)
#' bp_file.mode(fn)
#' bp_file.size(fn)
file.size = function(...) {
  base::file.info(...)$size
}

Try the backports package in your browser

Any scripts or data that you put into this service are public.

backports documentation built on June 24, 2024, 5:24 p.m.