\Header{file.info}{Extract File Information}
\keyword{file}{file.info}
\begin{Description}\relax
Utility function to extract information about files on the user's
file systems.
\end{Description}
\begin{Usage}
\begin{verbatim}
file.info(...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] character vectors containing file names.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
What is meant by \dQuote{file access} and hence the last access time
is system-dependent.

On most systems symbolic links are followed, so information is given
about the file to which the link points rather than about the link.
\end{Details}
\begin{Value}
A data frame with row names the file names and columns
\begin{ldescription}
\item[\code{size}] integer: File size in bytes.
\item[\code{isdir}] logical: Is the file a directory?
\item[\code{mode}] integer of class \code{"octmode"}.  The file permissions,
printed in octal, for example \code{644}.
\item[\code{mtime, ctime, atime}] integer of class \code{"POSIXct"}:
file modification, creation and last access times.
\item[\code{uid}] integer: the user ID of the file's owner.
\item[\code{gid}] integer: the group ID of the file's group.
\item[\code{uname}] character: \code{uid} interpreted as a user name.
\item[\code{grname}] character: \code{gid} interpreted as a group name.
\end{ldescription}

Unknown user and group names will be \code{NA}.

Entries for non-existent or non-readable files will be \code{NA}.
The \code{uid}, \code{gid}, \code{uname} and \code{grname} columns
may not be supplied on a non-POSIX Unix system.
\end{Value}
\begin{Note}\relax
This function will only be operational on systems with the
\code{stat} system call, but that seems very widely available.
\end{Note}
\begin{SeeAlso}\relax
\code{\Link{files}}, \code{\Link{file.access}},
\code{\Link{list.files}},
and \code{\Link{DateTimeClasses}} for the date formats.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
ncol(finf <- file.info(dir()))# at least six
## Not run: finf # the whole list
## Those that are more than 100 days old :
finf[difftime(Sys.time(), finf[,"mtime"], units="days") > 100 , 1:4]

file.info("no-such-file-exists")
\end{ExampleCode}
\end{Examples}

