--- src/ftp.ml.orig +++ src/ftp.ml @@ -275,7 +275,7 @@ let flags = if append then [O_WRONLY; O_APPEND] else [O_WRONLY; O_TRUNC; O_CREAT] in let foutd = openfile fout flags 0o644 in let buf_len = 16384 in - let buf = String.create buf_len in + let buf = Bytes.create buf_len in let len = ref 1 in let r = send_command fc (Retrieve fin) in if (fst r) = 550 then raise Not_found; @@ -473,7 +473,7 @@ val close : file_descr -> unit - val read : file_descr -> string -> int -> int -> int + val read : file_descr -> bytes -> int -> int -> int type seek_command = | SEEK_SET --- src/ftp.mli.orig +++ src/ftp.mli @@ -94,7 +94,7 @@ val resume_file : ftp_connection -> string -> string -> int -> unit (** [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 get_file_portion : ftp_connection -> string -> int -> string -> int -> int -> int +val get_file_portion : ftp_connection -> string -> int -> bytes -> int -> int -> int (** [mv fc src dst] moves the file [src] to [dst]. *) val mv : ftp_connection -> string -> string -> unit @@ -133,7 +133,7 @@ val close : file_descr -> unit (** Read data in an opened file. *) - val read : file_descr -> string -> int -> int -> int + val read : file_descr -> bytes -> int -> int -> int (** Positioning modes for [lseek]. *) type seek_command =