class ftp_fs :
?config_client:Ftp_client.ftp_client -> unit -> ?tmp_directory:string -> ?tmp_prefix:string -> ?get_password:string -> string -> ?get_account:string -> string -> ?keep_open:bool -> ?tls_config:(module Netsys_crypto_types.TLS_CONFIG) -> ?tls_enabled:bool -> ?tls_required:bool -> string ->
ftp_fs base_url: Access the FTP file system rooted at
base_url must follow the
base_url are ignored.
The following access methods are supported (compare with
Netfs.stream_fs). Note that not all FTP servers can perform
path_encoding: If the FTP server announces that it uses UTF-8 as path encoding, this is returned here; else
path_exclusions: is just
nominal_dot_dotis true. "." and ".." are resolved by the client before sending paths to the server.
read: is supported. Note that FTP distinguishes between text and binary mode, so don't forget to pass the
`Binaryflag if needed. The
`Skipflag is only emulated - the full file is retrieved first, and only the first bytes are hidden from the user. There is no support for streaming mode; the
`Streamingflag is ignored. This means that the file is first downloaded to a temporary file, and the returned object is just a handle for this file.
write: is supported, but - depending on the server - not all flag combinations. The flag list
[`Create; `Truncate]should always work. For other flag lists, the server needs to support the
MLSTcommand for checking whether the file already exists. If this support is missing, an FTP error is raised. It is not supported to omit both
`Truncate. Also, the
`Exclusiveflag is not supported. As for
read, there is no streaming mode, and a temporary file is used as container.
size: works only if the server supports the
SIZEcommand (otherwise ENOSYS).
test_list: works only if the server supports the
MLSTcommand (otherwise ENOSYS). The tests
`Xshould work. Files are never recognized as symlinks.
remove: works, but the
`Recursiveflag is not supported (and an emulation is considered as too dangerous)
mkdir: works, but the flags are ignored
config_client: one can enable further features on the client object (e.g. proxies)
tmp_directory: directory for temporary files
tmp_prefix: file prefix for temporary files (w/o directory)
get_password: This function should return the password for the user (passed in as argument). Defaults to "".
get_account: This function should return the account name for the user (passed in as argument). Defaults to "".
keep_open: By default, a new FTP connection is started for each operation, and it is shut down afterward. By setting
keep_openthe connection is kept open. The user has to call
tls_config: The TLS configuration to use. (If not set, a reasonable default is used.)
tls_enabled: whether TLS is enabled
tls_required: whether TLS is required