Skip to content

Commit 86fbb78

Browse files
committed
Update the docs for SCP operations.
1 parent b8ccc70 commit 86fbb78

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/Primary-API.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
The primary public API for this library is the following set of functions:
44

55
- `clj-libssh2.ssh/exec` - Execute a command on the remote host.
6+
- `clj-libssh2.ssh/scp-from` - SCP a file from the remote host.
7+
- `clj-libssh2.ssh/scp-to` - SCP a file to the remote host.
68
- `clj-libssh2.ssh/with-session` - A convenience macro for managing sessions.
79

810
If there are any breaking changes to the above-named functions after version
@@ -44,3 +46,25 @@ user=> (ssh/exec {:hostname "127.0.0.1"}
4446
{:out "foo\nbar\n", :err "", :exit 0, :signal {:exit-signal nil, :err-msg nil,
4547
:lang-tag nil}}
4648
```
49+
50+
### Copy a file from a remote machine.
51+
52+
```clojure
53+
user=> (require '[clj-libssh2.ssh :as ssh])
54+
nil
55+
user=> (ssh/scp-from {:hostname "127.0.0.1"} "/home/conor/.vimrc" ".vimrc")
56+
{:local-path ".vimrc", :remote-path "/home/conor/.vimrc", :size 4525,
57+
:remote-stat {:atime #object[java.time.Instant 0x3fc52110
58+
"2016-01-30T23:16:16Z"], :ctime #object[java.time.Instant 0x6de7c794
59+
"1970-01-01T00:00:00Z"], :gid 0, :mode 420, :mtime #object[java.time.Instant
60+
0x3e81f5e4 "2016-01-30T17:58:11Z"], :size 4525, :uid 0}}
61+
```
62+
63+
### Send a file to a remote machine.
64+
65+
```clojure
66+
user=> (require '[clj-libssh2.ssh :as ssh])
67+
nil
68+
user=> (ssh/scp-to {:hostname "127.0.0.1"} "/home/conor/.vimrc" "/tmp/.vimrc")
69+
nil
70+
```

0 commit comments

Comments
 (0)