Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Session
- data Channel
- data KnownHosts
- data Sftp
- data SftpHandle
- data SftpAttributes
- type SftpList = [(ByteString, SftpAttributes)]
- data SftpFileTransferFlags
- withSSH2 :: FilePath -> FilePath -> FilePath -> String -> String -> String -> Int -> (Session -> IO a) -> IO a
- withSSH2User :: FilePath -> String -> String -> String -> Int -> (Session -> IO a) -> IO a
- withSession :: String -> Int -> (Session -> IO a) -> IO a
- withChannel :: Session -> (Channel -> IO a) -> IO (Int, a)
- withChannelBy :: IO a -> (a -> Channel) -> (a -> IO b) -> IO (Int, b)
- checkHost :: Session -> String -> Int -> FilePath -> IO KnownHostResult
- readAllChannel :: Channel -> IO ByteString
- writeAllChannel :: Channel -> ByteString -> IO ()
- scpSendFile :: Session -> Int -> FilePath -> FilePath -> IO Integer
- scpReceiveFile :: Session -> FilePath -> FilePath -> IO Integer
- runShellCommands :: Session -> [String] -> IO (Int, [ByteString])
- execCommands :: Session -> [String] -> IO (Int, [ByteString])
- withSFTP :: FilePath -> FilePath -> FilePath -> String -> String -> String -> Int -> (Sftp -> IO a) -> IO a
- withSFTPUser :: FilePath -> String -> String -> String -> Int -> (Sftp -> IO a) -> IO a
- sftpListDir :: Sftp -> FilePath -> IO SftpList
- sftpRenameFile :: Sftp -> FilePath -> FilePath -> IO ()
- sftpSendFile :: Sftp -> FilePath -> FilePath -> Int -> IO Integer
- sftpSendFromHandle :: Sftp -> Handle -> FilePath -> Int -> IO Integer
- sftpReceiveFile :: Sftp -> FilePath -> FilePath -> IO Integer
- sftpReadFileToHandler :: SftpHandle -> Handle -> Int -> IO Int
- sftpFstat :: SftpHandle -> IO SftpAttributes
- sftpDeleteFile :: Sftp -> FilePath -> IO ()
- socketConnect :: String -> Int -> IO Socket
- sessionInit :: String -> Int -> IO Session
- sessionClose :: Session -> IO ()
Types
data KnownHosts Source #
type SftpList = [(ByteString, SftpAttributes)] Source #
data SftpFileTransferFlags Source #
Sftp support
Functions
:: FilePath | Path to known_hosts file |
-> FilePath | Path to public key file |
-> FilePath | Path to private key file |
-> String | Passphrase |
-> String | Remote user name |
-> String | Remote host name |
-> Int | Remote port number (usually 22) |
-> (Session -> IO a) | Actions to perform on session |
-> IO a |
Execute some actions within SSH2 connection. Uses public key authentication.
:: FilePath | Path to known_hosts file |
-> String | Remote user name |
-> String | Remote password |
-> String | Remote host name |
-> Int | Remote port number (usually 22) |
-> (Session -> IO a) | Actions to perform on session |
-> IO a |
Execute some actions within SSH2 connection. Uses username/password authentication.
:: String | Remote host name |
-> Int | Remote port number (usually 22) |
-> (Session -> IO a) | Actions to perform on handle and session |
-> IO a |
Execute some actions within SSH2 session
withChannel :: Session -> (Channel -> IO a) -> IO (Int, a) Source #
Execute some actions withing SSH2 channel
:: IO a | Create a channel (and possibly other stuff) |
-> (a -> Channel) | Extract the channel from "other stuff" |
-> (a -> IO b) | Actions to execute on the channel |
-> IO (Int, b) | Channel exit status and return value |
Generalization of withChannel
readAllChannel :: Channel -> IO ByteString Source #
Read all data from the channel
Although this function returns a lazy bytestring, the data is not read lazily.
writeAllChannel :: Channel -> ByteString -> IO () Source #
Write a lazy bytestring to the channel
:: Session | |
-> Int | File creation mode (0o777, for example) |
-> FilePath | Path to local file |
-> FilePath | Remote file path |
-> IO Integer |
Send a file to remote host via SCP. Returns size of sent data.
Receive file from remote host via SCP. Returns size of received data.
runShellCommands :: Session -> [String] -> IO (Int, [ByteString]) Source #
execCommands :: Session -> [String] -> IO (Int, [ByteString]) Source #
Sftp Functions
:: FilePath | Path to known_hosts file |
-> FilePath | Path to public key file |
-> FilePath | Path to private key file |
-> String | Passphrase |
-> String | Remote user name |
-> String | Remote host name |
-> Int | Remote port number (usually 22) |
-> (Sftp -> IO a) | Actions to perform on sftp session |
-> IO a |
Execute some actions within SFTP connection. Uses public key authentication.
:: FilePath | Path to known_hosts file |
-> String | Remote user name |
-> String | Remote password |
-> String | Remote host name |
-> Int | Remote port number (usually 22) |
-> (Sftp -> IO a) | Actions to perform on sftp session |
-> IO a |
Execute some actions within SFTP connection. Uses username/password authentication.
Reads directory information Returns the list of files with attributes, directory . and .. are not excluded
Rename a file on the sftp server
:: Sftp | Opened sftp session |
-> FilePath | Path to local file |
-> FilePath | Remote file path |
-> Int | File creation mode (0o777, for example) |
-> IO Integer |
Send a file to remote host via SFTP Returns size of sent data.
:: Sftp | Opened sftp session |
-> Handle | Handle to read from |
-> FilePath | Remote file path |
-> Int | File creation mode (0o777, for example) |
-> IO Integer |
Send a file to remote host via SFTP Returns size of sent data.
Received a file from remote host via SFTP Returns size of received data.
sftpReadFileToHandler :: SftpHandle -> Handle -> Int -> IO Int Source #
Download file from the sftp server
sftpFstat :: SftpHandle -> IO SftpAttributes Source #
Get sftp attributes from the sftp handler
Delete file from SFTP server
Utilities
socketConnect :: String -> Int -> IO Socket Source #
Similar to Network.connectTo, but does not socketToHandle.
sessionClose :: Session -> IO () Source #