module Ftp:sig..end
type ftp_connection
type file_kind =
| |
S_REG |
(* |
regular file
| *) |
| |
S_DIR |
(* |
directory
| *) |
| |
S_CHR |
(* |
character device
| *) |
| |
S_BLK |
(* |
block device
| *) |
| |
S_LNK |
(* |
symbolic link
| *) |
| |
S_FIFO |
(* |
named pipe
| *) |
| |
S_SOCK |
(* |
socket
| *) |
typefile_perm =int
type stats = {
|
st_kind : |
(* |
kind of the file
| *) |
|
st_perm : |
(* |
access rights
| *) |
|
st_nlink : |
(* |
number of links
| *) |
|
st_un : |
(* |
user name of the owner
| *) |
|
st_gn : |
(* |
group of the file's group
| *) |
|
st_size : |
(* |
size in bytes
| *) |
|
st_mtime : |
(* |
last modification time
| *) |
exception Unrecognised_format
stat correctly (the rfc of the ftp is infamous and does not specify the format of the output of the command LIST).val connect : string -> int -> string -> string -> ftp_connectionconnect server port login pass connects to the server named server on port port using the given login and password.val disconnect : ftp_connection -> unitval set_passive : ftp_connection -> bool -> unitval get_cur_dir : ftp_connection -> stringval chdir : ftp_connection -> string -> unitval chdir_up : ftp_connection -> unitval list_files : ftp_connection -> string -> string listval get_file_size : ftp_connection -> string -> intval ls : ftp_connection -> string -> (string * stats) listval stat : ftp_connection -> string -> statsget_size which is supposed to work better.val get_file : ftp_connection -> string -> string -> unitget_file fc src dst downloads the file src and stores it in dst. Warning: if the file already exists it is replaced.val resume_file : ftp_connection -> string -> string -> int -> unitresume_file fc src dst ofs downloads the file src starting at offset ofs and appends it to dst. Raises Not_found if the file does not already exists.val get_file_portion : ftp_connection -> string -> int -> string -> int -> int -> intget_file_portion fc src file_ofs buf ofs len downloads len octets of file src starting at position file_ofs and stores it in buf starting at position ofs. Returns the number of bytes actually read.val mv : ftp_connection -> string -> string -> unitmv fc src dst moves the file src to dst.val rm : ftp_connection -> string -> unitval rmdir : ftp_connection -> string -> unitval mkdir : ftp_connection -> string -> unitval nop : ftp_connection -> unitmodule type FILE =sig..end
module File:FILE