file.info {base}R Documentation

Extract File Information

Description

Utility function to extract information about files on the user's file systems.

Usage

file.info(...)

Arguments

... character vectors containing file names.

Details

What is meant by ``file access'' and hence the last access time is system-dependent.

File modes are probably only useful on Windows NT/2000 machines.

Value

A data frame with row names the file names and columns

size integer: File size in bytes.
isdir logical: Is the file a directory?
mode integer of class "octmode". The file permissions, printed in octal, for example 644.
mtime, ctime, atime integer of class "POSIXct": file modification, creation and last access times.


Entries for non-existent or non-readable files will be NA.

Note

This function will only be operational on systems with the stat system call, but that seems very widely available.

Author(s)

B. D. Ripley

See Also

files, file.access, list.files, and DateTimeClasses for the date formats.

Examples

ncol(finf <- file.info(dir()))# at least six
finf # the whole list
## Those that are more than 100 days old :
finf[ (Sys.time() - finf[,"mtime"]) > (24*60^2) * 100 , 1:4]

file.info("no-such-file-exists")