Ocamlnet 3 Reference Manual : Ftp_client

`sig
exception FTP_error of exn
exception FTP_protocol_violation of string
exception FTP_timeout of string
type cmd_state =
[ `Init
| `Not_connected
| `Pass_acct_seq
| `Perm_failure
| `Preliminary
| `Proto_error
| `Rename_seq
| `Restart_seq
| `Success
| `Temp_failure
| `User_acct_seq
| `User_pass_seq ]
type port =
[ `Active of string * int * Unix.file_descr
| `Ext_active of string * int * Unix.file_descr
| `Ext_passive of int
| `Passive of string * int
| `Unspecified ]
type form_code = [ `ASA | `Non_print | `Telnet ]
type representation =
[ `ASCII of Ftp_client.form_code option
| `EBCDIC of Ftp_client.form_code option
| `Image ]
type structure = [ `File_structure | `Record_structure ]
type transmission_mode = [ `Block_mode | `Stream_mode ]
type ftp_state = {
cmd_state : Ftp_client.cmd_state;
ftp_connected : bool;
ftp_data_conn : bool;
ftp_user : string option;
ftp_password : string option;
ftp_account : string option;
ftp_logged_in : bool;
ftp_port : Ftp_client.port;
ftp_repr : Ftp_client.representation;
ftp_structure : Ftp_client.structure;
ftp_trans : Ftp_client.transmission_mode;
ftp_dir : string list;
ftp_features : (string * string option) list option;
ftp_options : (string * string option) list;
}
type cmd =
[ `ACCT of string
| `ALLO of int * int option
| `APPE of
string * (Ftp_client.ftp_state -> Ftp_data_endpoint.local_sender)
| `CDUP
| `CWD of string
| `Connect of string * int
| `DELE of string
| `Disconnect
| `Dummy
| `EPRT
| `EPSV of [ `AF of Unix.socket_domain | `ALL ] option
| `FEAT
| `HELP of string option
| `LANG of string option
| `LIST of
string option *
(Ftp_client.ftp_state -> Ftp_data_endpoint.local_receiver)
| `MDTM of string
| `MKD of string
| `MLSD of
string option *
(Ftp_client.ftp_state -> Ftp_data_endpoint.local_receiver)
| `MLST of string option
| `MODE of Ftp_client.transmission_mode
| `NLST of
string option *
(Ftp_client.ftp_state -> Ftp_data_endpoint.local_receiver)
| `NOOP
| `OPTS of string * string option
| `PASS of string
| `PASV
| `PORT
| `PWD
| `QUIT
| `REIN
| `REST of string
| `RETR of
string * (Ftp_client.ftp_state -> Ftp_data_endpoint.local_receiver)
| `RMD of string
| `RNFR of string
| `RNTO of string
| `SITE of string
| `SIZE of string
| `SMNT of string
| `STAT of string option
| `STOR of
string * (Ftp_client.ftp_state -> Ftp_data_endpoint.local_sender)
| `STOU of Ftp_client.ftp_state -> Ftp_data_endpoint.local_sender
| `STRU of Ftp_client.structure
| `SYST
| `TYPE of Ftp_client.representation
| `USER of string ]
type reply = int * string
class type ftp_client_pi =
object
method abort : unit -> unit
method event_system : Unixqueue.event_system
method exec_e :
?prelim:(Ftp_client.ftp_state -> Ftp_client.reply -> unit) ->
Ftp_client.cmd ->
(Ftp_client.ftp_state * Ftp_client.reply) Uq_engines.engine
method ftp_state : Ftp_client.ftp_state
method is_empty : bool
method mlst_enabled_facts : string list
method mlst_facts : string list
method need_ip6 : bool
method request_notification : (unit -> bool) -> unit
method run : unit -> unit
method send_abort : unit -> unit
method state : unit Uq_engines.engine_state
method supports_mdtm : bool
method supports_mlst : bool
method supports_size : bool
method supports_tvfs : bool
method supports_utf8 : bool
end
type ftp_method = Ftp_client.ftp_client_pi -> unit Uq_engines.engine
exception FTP_method_temp_failure of int * string
exception FTP_method_perm_failure of int * string
exception FTP_method_unexpected_reply of int * string
val connect_method :
host:string -> ?port:int -> unit -> Ftp_client.ftp_method
val login_method :
user:string ->
get_password:(unit -> string) ->
get_account:(unit -> string) -> unit -> Ftp_client.ftp_method
val quit_method : unit -> Ftp_client.ftp_method
val walk_method :
[ `Dir of string | `File of string | `Stay ] -> Ftp_client.ftp_method
type filename = [ `NVFS of string | `TVFS of string | `Verbatim of string ]
val get_method :
file:Ftp_client.filename ->
representation:Ftp_client.representation ->
store:(Ftp_client.ftp_state -> Ftp_data_endpoint.local_receiver) ->
unit -> Ftp_client.ftp_method
val put_method :
?meth:[ `APPE | `STOR ] ->
file:Ftp_client.filename ->
representation:Ftp_client.representation ->
store:(Ftp_client.ftp_state -> Ftp_data_endpoint.local_sender) ->
unit -> Ftp_client.ftp_method
val invoke_method : command:Ftp_client.cmd -> unit -> Ftp_client.ftp_method
val set_structure_method : Ftp_client.structure -> Ftp_client.ftp_method
val set_mode_method : Ftp_client.transmission_mode -> Ftp_client.ftp_method
val rename_method :
file_from:Ftp_client.filename ->
file_to:Ftp_client.filename -> unit -> Ftp_client.ftp_method
val mkdir_method : Ftp_client.filename -> Ftp_client.ftp_method
val rmdir_method : Ftp_client.filename -> Ftp_client.ftp_method
val delete_method : Ftp_client.filename -> Ftp_client.ftp_method
val list_method :
dir:Ftp_client.filename ->
representation:Ftp_client.representation ->
store:(Ftp_client.ftp_state -> Ftp_data_endpoint.local_receiver) ->
unit -> Ftp_client.ftp_method
val nlst_method :
dir:Ftp_client.filename ->
representation:Ftp_client.representation ->
store:(Ftp_client.ftp_state -> Ftp_data_endpoint.local_receiver) ->
unit -> Ftp_client.ftp_method
val parse_nlst_document : string -> string list
val mdtm_method :
file:Ftp_client.filename ->
process_result:(float -> unit) -> unit -> Ftp_client.ftp_method
val size_method :
file:Ftp_client.filename ->
representation:Ftp_client.representation ->
process_result:(int64 -> unit) -> unit -> Ftp_client.ftp_method
val feat_method :
?process_result:((string * string option) list -> unit) ->
unit -> Ftp_client.ftp_method
type entry = string * (string * string) list
val mlst_method :
file:Ftp_client.filename ->
process_result:(Ftp_client.entry list -> unit) ->
unit -> Ftp_client.ftp_method
val mlsd_method :
dir:Ftp_client.filename ->
store:(Ftp_client.ftp_state -> Ftp_data_endpoint.local_receiver) ->
unit -> Ftp_client.ftp_method
val parse_mlsd_document : string -> Ftp_client.entry list
type entry_type = [ `Cdir | `Dir | `File | `Other | `Pdir ]
type entry_perm =
[ `Append
| `Create
| `Delete
| `Delete_member
| `Enter
| `List
| `Mkdir
| `Read
| `Rename
| `Write ]
val get_name : Ftp_client.entry -> string
val get_size : Ftp_client.entry -> int64
val get_modify : Ftp_client.entry -> float
val get_create : Ftp_client.entry -> float
val get_type : Ftp_client.entry -> Ftp_client.entry_type
val get_unique : Ftp_client.entry -> string
val get_perm : Ftp_client.entry -> Ftp_client.entry_perm list
val get_lang : Ftp_client.entry -> string
val get_media_type : Ftp_client.entry -> string
val get_charset : Ftp_client.entry -> string
val get_unix_mode : Ftp_client.entry -> int
val get_unix_uid : Ftp_client.entry -> string
val get_unix_gid : Ftp_client.entry -> string
class ftp_client :
?event_system:Unixqueue.event_system ->
unit ->
object
method configure_timeout : float -> unit
method event_system : Unixqueue.event_system
method exec : Ftp_client.ftp_method -> unit
method exec_e : Ftp_client.ftp_method -> unit Uq_engines.engine
method pi : Ftp_client.ftp_client_pi
method reset : unit -> unit
method run : unit -> unit
method set_socks5_proxy : string -> int -> unit
end
module Debug : sig val enable : bool Pervasives.ref end
end`