Module

Node.Network.SftpClient

Package
purescript-ssh2-sftp-client
Repository
adamczykm/purescript-ssh2-sftp-client

#SftpSessionM Source

newtype SftpSessionM a

This type represents a SFTP session. It hides unsafe internals of underlying JS package. Each command provided by this library will return a SftpSessionM action Running SftpSessionM handles both connecting and disconnecting from server even in case of exception.

Instances

#runSftpSession Source

runSftpSession :: forall a. Config -> SftpSessionM a -> Aff a

Assembles SftpSessionM into a single Aff. Under the hood it makes sure that underlying connection is closed even in the presence of an exception.

#list Source

list :: String -> SftpSessionM (Array FileInfo)

Function creating an action executing SFTP command. List directory given as first argument. E.g. list "/"j

#rmdir Source

rmdir :: { path :: String, recursive :: Boolean } -> SftpSessionM Unit

Function creating an action executing SFTP command. Removes directory path from remote location.

#mkdir Source

mkdir :: { path :: String, recursive :: Boolean } -> SftpSessionM Unit

Function creating an action executing SFTP command. Creates a remote directory under the given path.

#rename Source

rename :: { from :: String, to :: String } -> SftpSessionM Unit

Function creating an action executing SFTP command. Renames remote location

#delete Source

delete :: String -> SftpSessionM Unit

Function creating an action executing SFTP command. Deletes file under the path given as a first argument.

#chmod Source

chmod :: { dest :: String, mode :: String } -> SftpSessionM Unit

Function creating an action executing SFTP command. Changing access mode of remote file. E.g. chmod { dest: "/file.md", mode: "775" }

#fastGet Source

fastGet :: { local :: String, remote :: String } -> SftpSessionM Unit

Function creating an action executing SFTP command. Downloads file from remote path using parallel reads.

#fastPut Source

fastPut :: { local :: String, remote :: String } -> SftpSessionM Unit

Function creating an action executing SFTP command. Uploads file under local path using parallel writes.

Re-exports from Node.Network.SftpClient.UnsafeInternal

#FileInfo Source

type FileInfo = { accessTime :: Int, group :: Int, modifyTime :: Int, name :: String, owner :: Int, rights :: { group :: String, other :: String, user :: String }, size :: Int, type :: String }

#Config Source

type Config = { host :: String, password :: String, port :: String, username :: String }