File: scp.Rd

package info (click to toggle)
r-cran-rcurl 1.95-4.8-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,140 kB
  • ctags: 515
  • sloc: ansic: 3,135; xml: 1,734; asm: 993; sh: 12; makefile: 2
file content (66 lines) | stat: -rw-r--r-- 2,341 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
\name{scp}
\Rdversion{1.1}
\alias{scp}
\title{Retrieve contents of a file from a remote host via SCP (Secure Copy)}
\description{
 This function allows us to retrieve the contents of a file from a
 remote host via SCP. This is done entirely within R, rather than
 a command line application and the contents of the file are never
 written to disc.  The function allows the 
}
\usage{
scp(host, path, keypasswd = NA, user = getUserName(), rsa = TRUE,
     key = sprintf(c("~/.ssh/id_\%s.pub", "~/.ssh/id_\%s"),
                   if (rsa) "rsa" else "dsa"),
     binary = NA, size = 5000, curl = getCurlHandle(), ...)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{host}{the name of the remote host or its IP address}
  \item{path}{the path of the file of interest on the remote host's file
  systems}
  \item{keypasswd}{a password for accessing the local SSH key. This is
    the passphrase for the key.}
  \item{user}{the name of the user on the remote machine}
  \item{rsa}{a logical value indicating whether to use the RSA or DSA key}
  \item{key}{the path giving the location of the SSH key. }
  \item{binary}{a logical value giving }
  \item{size}{an estimate of the size of the buffer needed to store the
    contents of the file. This is used to initialize the buffer and
    potentially avoid resizing it as needed.}
  \item{curl}{a curl handle (\code{\link{getCurlHandle}}) that is to be
    reused for this request and which potentially contains numerous
    options settings or an existing connection to the host.}
  \item{\dots}{additional parameters handed to \code{\link{curlPerform}}.}
}
\details{This uses libcurl's facilities for scp.
  Use \code{"scp" \%in\% curlVersion()$protocols} to
  see if SCP is supported.
}
\value{
 Either a raw or character vector giving the contents of the file.
}
\references{
 libcurl \url{http://curl.haxx.se}
}
\author{
Duncan Temple Lang
}


\seealso{
  \code{\link{curlPerform}}
  \code{\link{getCurlOptionsConstants}}
}
\examples{
\dontrun{
   x = scp("eeyore.ucdavis.edu", "/home/duncan/OmegaWeb/index.html",
           "My.SCP.Passphrase", binary = FALSE)
   x = scp("eeyore.ucdavis.edu", "/home/duncan/OmegaWeb/RCurl/xmlParse.bz2",
           "My.SCP.Passphrase")
   if(require(Rcompression))
      o = bunzip2(x)
}
}
\keyword{IO}
\keyword{programming}