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_connection
connect server port login pass
connects to the server named server
on port port
using the given login and password.val disconnect : ftp_connection -> unit
val set_passive : ftp_connection -> bool -> unit
val get_cur_dir : ftp_connection -> string
val chdir : ftp_connection -> string -> unit
val chdir_up : ftp_connection -> unit
val list_files : ftp_connection -> string -> string list
val get_file_size : ftp_connection -> string -> int
val ls : ftp_connection -> string -> (string * stats) list
val stat : ftp_connection -> string -> stats
get_size
which is supposed to work better.val get_file : ftp_connection -> string -> string -> unit
get_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 -> unit
resume_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 -> int
get_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 -> unit
mv fc src dst
moves the file src
to dst
.val rm : ftp_connection -> string -> unit
val rmdir : ftp_connection -> string -> unit
val mkdir : ftp_connection -> string -> unit
val nop : ftp_connection -> unit
module type FILE =sig
..end
module File:FILE