dir.sort: sort files in a directory numerically

Description Usage Arguments Value Author(s)

Description

If your files contain a simple pattern, like:
tmp1.out, tmp2.out, ..., tmp10.out, ...
and you want to process them in this order:
1,2,...,10,..., then use dir.sort. dir() does an alphanumeric sort, so you would get tmp10.out, tmp1.out, ...

Usage

1
dir.sort(path = ".", pattern = NULL, ...)

Arguments

path

the path to a directory. default=current working directory

pattern

an optional regular expression. Only file names which match the regular expression will be returned.

...

arguments passed to dir

Value

A character vector containing the names of the files in the specified directories, or "" if there were no files. If a path does not exist or is not a directory or is unreadable it is skipped, with a warning.

Author(s)

Mark Cowley, 2005-05-03


drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.