View source: R/sevenzip_listcont.R
sevenzip_listcont | R Documentation |
List the contents of one or more valid file 7-zip extensions in a directory
sevenzip_listcont(archive_path, extras = NULL, recursive = FALSE, parse = TRUE)
archive_path |
A path containing valid file extensions. See details for allowed extensions. |
extras |
Additional arguments to pass to |
recursive |
Should the call to |
parse |
Parse the raw return via |
Valid file extensions include 7z, zip, rar, gzip, rar, gzip, tar, bzip2, gz, tar.gz,
tgz, bz, wim
. File (directory) listing is performed with a (non-recursive by default) call to
list.files
. An error is raised if no files including one of these
extensions are found in archive_path.
Running this with recursive=TRUE
can be a useful way to get a listing of the contents of all valid
archive files in a directory. Note, though, that this can take some time, depending on the
scope and/or level of nesting of the target directory.
By default, a list
of length 2:
success
A list
; if no valid archive contents could be accessed, then an
empty list
of length 1, otherwise, of length 2:
is_parseable
: A data.frame
of successfully parsed items, unless no items
were parseable, in which case an empty list, i.e. list()
not_parseable
: A list
of unparseable items, containing the raw text output;
if none, then an empty list, i.e. list()
failure
A list
of archives where 7-zip could not access any files within.
If parse=FALSE
, then a list
of raw output
There is no guarantee that this will work for a non-Windows OS.
recursive refers to the files in a directory, and not the contents of each archive. In other words, this function will not look beyond the first listing level in an archive.
Other sevenzip functions:
sevenzip_checkpath()
,
sevenzip_makecmd()
,
sevenzip_parseinfo()
# TBD
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.