View source: R/ftp_parseMeta.R
ftp_parseMeta | R Documentation |
Parse ftp return from getURL call with no options
ftp_parseMeta(ret)
ret |
(required) A character vector; the return from a call to
|
The expected input assumes that getURL
is called with the bare minimum options,
i.e. only url
and, if necessary, userpwd
. Since there is no input checking, this
function handles un-parse-able inputs by returning the input as-is.
If at least one field in ret was parsed, a data.table
containing eight
fields, plus the input (so nine total). Fields include:
original
(chr); the original input, for reference
permissions
(chr); flags denoting various access and modification parameters,
unparsed.
type_code
(int); the type of asset. Typically, 1
denotes a file, while 2
a directory
owner_group
(chr); a space
-delimited vector denoting the owner and group
size
(dbl); for a file
, the size in bytes. This may not be meaningful for
directories.
name
(chr); the name of the asset; if a file, will include the extension.
mod_time
(chr); the time of the mod_date
mod_date
(chr); the date, possibly only the three-letter month, space
date (of month)
if the last modification date is less than 6 months from the current date (of the endpoint).
mod_year
(int): the last modified year. This information is not included for files that are
created in the current year, and so is inferred in such cases to the current year.
If ret could not be parsed at all, i.e. if all NA
, then the input is returned
as-is, with a warning.
Other ftp_functions:
ftp_getBinPars()
,
ftp_listDir()
,
ftp_makeParams()
## Not run: library(RCurl) # get basic metadata from an ftp endpoint my_params <- ftp_makeParams(host = "ftp.123.com", user = "myself", pwd = "my_pwd") my_meta <- do.call(getURL, my_params) ftp_parseMeta(my_meta) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.