Description Usage Arguments Value Warning TODO Author(s) Examples
Uses ncftpls, and via ftp.opts and ls.opts, you can specify a range of options. see examples, and type ncftpls on the commandline to see the full range of options. ncftpls behaves differently depending on whether there's a trailing slash. in this R version, all URL's will have a trailing slash.
1 2 |
url |
the full url to the directory. need trailing '/' to get just the filenames. |
ftp.opts |
a non-NULL character vector of FTP options. see ncftpls help |
ls.opts |
a non-NULL character vector of ls options. see ncftpls help |
pattern |
an optional regular expression. Only file names which match the regular expression will be returned. The pattern is applied to the filename, not the whole URL. |
full.names |
logical: if |
a chracter vector of output. usually a file listing
on OSX and Ubuntu, the '-g' and '-gg' recursive modes don't work. untested on CentOS. '-R' mode does work, but produces a long listing. note '-R -1' does not recurse.
implement recursive, by in the back end, doing ls.opts="-l" & selecting directories by "^d"
Mark Cowley, 2013-05-21
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # connect to port 10021 of Garvan's FTP server & do a listing
ftpdir("ftp://ftp.pwbc.garvan.unsw.edu.au/pub/genepattern/modules/NormalizeAffymetrixST/chip/", ftp.opts="-P 10021", ls.opts="-1")
ftpdir("ftp://ftp.pwbc.garvan.unsw.edu.au/pub/genepattern/modules/NormalizeAffymetrixST/chip/", ftp.opts="-P 10021", ls.opts="-1", full.names=TRUE)
ftpdir("ftp://ftp.pwbc.garvan.unsw.edu.au/pub/genepattern/modules/NormalizeAffymetrixST/chip", ftp.opts="-P 10021", ls.opts="-1")
# recursive, long listing
ftpdir("ftp://ftp.pwbc.garvan.unsw.edu.au/pub/genepattern/modules/NormalizeAffymetrixST/chip/", ftp.opts="-P 10021", ls.opts="-R")
# recursive, short listing (doesn't work)
ftpdir("ftp://ftp.pwbc.garvan.unsw.edu.au/pub/genepattern/modules/NormalizeAffymetrixST/chip/", ftp.opts="-P 10021", ls.opts="-1 -g")
# As above, but append a "/" character to directory pathnames. (doesn't work; doesn't add trailing slash...)
ftpdir("ftp://ftp.pwbc.garvan.unsw.edu.au/pub/genepattern/modules/NormalizeAffymetrixST/", ftp.opts="-P 10021", ls.opts="-1 -gg")
# test patterns
ftpdir("ftp://ftp.pwbc.garvan.unsw.edu.au/pub/genepattern/modules/NormalizeAffymetrixST/chip/", ftp.opts="-P 10021", pattern="rn4")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.