Return the newest file from a vector of files
Arguments
- x
character
vector of files, specifying file path where required.- timecol
character
value from the output ofbase::file.info()
indicating the time column used to order files. By default"mtime"
refers to the time the file was last modified.- n
integer
number of files to return, in order of the most recent to the least recent. By defaultn=1
returns only the one newest file.- ...
additional parameters are ignored.
Value
character
vector length=1
of the most recently modified file
from the input vector x
. Note that any files not found are removed,
using base::file.exists()
, which means invalid symlinks will be ignored.
Details
This function returns the newest file, defined by the most
recently modified time obtained from base::file.info()
.
See also
Other jam practical functions:
breakDensity()
,
call_fn_ellipsis()
,
checkLightMode()
,
check_pkg_installed()
,
colNum2excelName()
,
color_dither()
,
exp2signed()
,
getAxisLabel()
,
isFALSEV()
,
isTRUEV()
,
jargs()
,
kable_coloring()
,
lldf()
,
log2signed()
,
middle()
,
minorLogTicks()
,
printDebug()
,
reload_rmarkdown_cache()
,
renameColumn()
,
rmInfinite()
,
rmNA()
,
rmNAs()
,
rmNULL()
,
setPrompt()
Examples
newestFile(list.files());
#> [1] "nameVectorN.html"