Namespaces

 
0.2.0-SNAPSHOT Arrow_down_16x16

ssh-sftp-cmd

clj-ssh.ssh

  • (ssh-sftp-cmd channel cmd args options)
Command on a ftp channel.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clj_ssh/ssh.clj:465 top

(defn ssh-sftp-cmd
  "Command on a ftp channel."
  [#^ChannelSftp channel cmd args options]
  (condp = cmd
    :ls (.ls channel (or (first args) "."))
    :cd (.cd channel (first args))
    :lcd (.lcd channel (first args))
    :chmod (.chmod channel (first args) (second args))
    :chown (.chown channel (first args) (second args))
    :chgrp (.chgrp channel (first args) (second args))
    :pwd (.pwd channel)
    :lpwd (.lpwd channel)
    :rm (.rm channel (first args))
    :rmdir (.rmdir channel (first args))
    :rmdir (.mkdir channel (first args))
    :stat (.stat channel (first args))
    :lstat (.lstat channel (first args))
    :rename (.rename channel (first args) (second args))
    :symlink (.symlink channel (first args) (second args))
    :readlink (.readlink channel (first args))
    :realpath (.realpath channel (first args) (second args))
    :get-home (.getHome channel)
    :get-server-version (.getServerVersion channel)
    :get-extension (.getExtension channel (first args))
    :get (let [args (if (options :with-monitor)
                      (conj args (options :with-monitor))
                      args)
               args (if (options :mode)
                      (conj args (sftp-modemap (options :mode)))
                      args)]
           ((memfn-varargs get) channel args))
    :put (let [args (if (options :with-monitor)
                      (conj args (options :with-monitor))
                      args)
               args (if (options :mode)
                      (conj args (sftp-modemap (options :mode)))
                      args)]
           ((memfn-varargs put) channel args))
    (throw (java.lang.IllegalArgumentException.
            (str "Unknown SFTP command " cmd)))))
Vars in clj-ssh.ssh/ssh-sftp-cmd: = condp defn first get let or second str
Used in 0 other vars

Comments top

No comments for ssh-sftp-cmd. Log in to add a comment.