Learn R Programming

memuse (version 2.5)

filesize: filesize

Description

Returns size of a file as reported by the file system (the file is not scanned).

Usage

Sys.filesize(filename)

Arguments

filename
Location of the file (as a string).

Value

A memuse class object.

Details

All of the C-level source code for these methods (in src/meminfo of the root directory of the memuse source tree) is licensed under the permissive 2-Clause BSD license.

Examples

Run this code
## Not run: 
# library(memuse)
# 
# x <- rnorm(1e5)
# object.size(x) ### size in ram
# 
# tmp <- tempfile()
# saveRDS(x, file=tmp)
# Sys.filesize(tmp) ### size on disk
# unlink(tmp)
# ## End(Not run)

Run the code above in your browser using DataLab