ftphs-1.0.9.2: FTP Client and Server Library

CopyrightCopyright (C) 2004 John Goerzen
LicenseGNU LGPL, version 2.1 or above
MaintainerJohn Goerzen <jgoerzen@complete.org>
Stabilityprovisional
Portabilitysystems with networking
Safe HaskellNone
LanguageHaskell98

Network.FTP.Client.Parser

Contents

Description

This module provides a parser that is used internally by Network.FTP.Client. You almost certainly do not want to use this module directly. Use Network.FTP.Client instead.

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Documentation

parseReply :: String -> FTPResult Source #

Parse a FTP reply. Returns a (result code, text) pair.

parseGoodReply :: String -> IO FTPResult Source #

Parse a FTP reply. Returns a (result code, text) pair. If the result code indicates an error, raise an exception instead of just passing it back.

toPortString :: SockAddr -> IO String Source #

Converts a socket address to a string suitable for a PORT command.

Example:

toPortString (SockAddrInet (PortNum 0x1234) (0xaabbccdd)) ->
                             "170,187,204,221,18,52"

fromPortString :: String -> IO SockAddr Source #

Converts a port string to a socket address. This is the inverse calculation of toPortString.

debugParseGoodReply :: String -> IO FTPResult Source #

Parse a FTP reply. Logs debug messages.

respToSockAddr :: FTPResult -> IO SockAddr Source #

Converts a response code to a socket address

Utilities

unexpectedresp :: Show a => [Char] -> a -> [Char] Source #

isxresp :: (Num a, Ord a) => a -> (a, t) -> Bool Source #

forcexresp :: (Show t, Show a, Ord a, Num a) => a -> (a, t) -> (a, t) Source #