Lester L. Martin II
UWB, bobef
BSD style: see
license.txt
Initial release: August 8, 2008
- alias void delegate(in size_t pos) FtpProgress ¶
-
An FTP progress delegate.
You may need to add the restart position to this, and use SIZE to determine
percentage completion. This only represents the number of bytes
transferred.
pos | the current offset into the stream |
- enum FtpFormat ¶
-
The format of data transfer.
- ascii ¶
-
Indicates ASCII NON PRINT format (line ending conversion to CRLF.)
- image ¶
-
Indicates IMAGE format (8 bit binary octets.)
- struct FtpAddress ¶
-
A FtpAddress structure that contains all
that is needed to access a FTPConnection; Contributed by Bobef
0.99.8
- struct FtpResponse ¶
-
A server response, consisting of a code and a potentially multi-line
message.
- char[3] code ¶
-
The response code.
The digits in the response code can be used to determine status
programatically.
First Digit (status):
1xx = a positive, but preliminary, reply
2xx = a positive reply indicating completion
3xx = a positive reply indicating incomplete status
4xx = a temporary negative reply
5xx = a permanent negative reply
Second Digit (subject):
x0x = condition based on syntax
x1x = informational
x2x = connection
x3x = authentication/process
x5x = file system
- const(char)[] message ¶
-
The message from the server.
With some responses, the message may contain parseable information.
For example, this is true of the 257 response.
- enum FtpConnectionType ¶
-
Active or passive connection mode.
- active ¶
-
Active - server connects to client on open port.
- passive ¶
-
Passive - server listens for a connection from the client.
- struct FtpConnectionDetail ¶
-
Detail about the data connection.
This is used to properly send PORT and PASV commands.
- FtpConnectionType type ¶
-
- Address address ¶
-
The address to give the server.
- Address listen ¶
-
The address to actually listen on.
- struct FtpFeature ¶
-
A supported feature of an FTP server.
- const(char)[] command ¶
-
The command which is supported, e.g. SIZE.
- const(char)[] params ¶
-
Parameters for this command; e.g. facts for MLST.
- enum FtpFileType ¶
-
The type of a file in an FTP listing.
- unknown ¶
-
An unknown file or type (no type fact.)
- file ¶
-
A regular file, or similar.
- cdir ¶
-
The current directory (e.g. ., but not necessarily.)
- pdir ¶
-
A parent directory (usually "..".)
- dir ¶
-
Any other type of directory.
- other ¶
-
Another type of file. Consult the "type" fact.
- struct FtpFileInfo ¶
-
Information about a file in an FTP listing.
- const(char)[] name ¶
-
- FtpFileType type ¶
-
- ulong size ¶
-
Size in bytes (8 bit octets), or ulong.max if not available.
0.99.8
- Time modify ¶
-
Modification time, if available.
- Time create ¶
-
Creation time, if available (not often.)
- const(char)[] mime ¶
-
The file's mime type, if known.
- const(char)[][const(char)[]] facts ¶
-
An associative array of all facts returned by the server, lowercased.
- class FtpException : Exception ¶
-
Changed location Since: 0.99.8
Documentation Pending
- this(string message, char[3] code = "420") ¶
-
Construct an FtpException based on a message and code.
message | the exception message |
code | the code (5xx for fatal errors) |
- this(FtpResponse r) ¶
-
Construct an FtpException based on a response.
- string toString() [override] ¶
-
A string representation of the error.
- class FTPConnection : Telnet ¶
-
Seriously changed Since: 0.99.8
Documentation pending
- TimeSpan timeout() [public, @property] ¶
-
- void timeout(TimeSpan t) [public, @property] ¶
-
- TimeSpan shutdownTime() [public] ¶
-
- FtpFeature[] supportedFeatures() [public] ¶
-
- void exception(string message) [override] ¶
-
- void exception(FtpResponse fr) ¶
-
- this(FtpAddress fad) [public] ¶
-
- void connect(FtpAddress fad) [public] ¶
-
- void connect(const(char)[] hostname, const(char)[] username = "anonymous", const(char)[] password = "anonymous@anonymous", uint port = 21) [public] ¶
-
- int exist(const(char)[] file) ¶
-
- Time modified(const(char)[] file) ¶
-
- Socket getDataSocket() [protected] ¶
-
Get a data socket from the server.
This sends PASV/PORT as necessary.
the data socket or a listener
Changed Since: 0.99.8
- void prepareDataSocket(ref Socket data) [protected] ¶
-
Prepare a data socket for use.
This modifies the socket in some cases.
data | the data listener socket
Changed Since: 0.99.8 |
- void finishDataCommand(Socket data) [public] ¶
-
- Socket processDataCommand(const(char)[] command, const(char)[][] parameters...) [public] ¶
-
- void readStream(Socket data, OutputStream stream, FtpProgress progress = null) [protected] ¶
-
- void sendStream(Socket data, InputStream stream, FtpProgress progress = null) [protected] ¶
-
- void put(const(char)[] path, InputStream stream = null, FtpProgress progress = null, FtpFormat format = image) [public] ¶
-
Store data from a stream on the server.
Calling this function will change the current data transfer format.
path | the path to the remote file |
stream | data to store, or null for a blank file |
progress | a delegate to call with progress information |
format | what format to send the data in |
- void append(const(char)[] path, InputStream stream, FtpProgress progress = null, FtpFormat format = image) [public] ¶
-
Append data to a file on the server.
Calling this function will change the current data transfer format.
path | the path to the remote file |
stream | data to append to the file |
progress | a delegate to call with progress information |
format | what format to send the data in |
- void restartSeek(size_t offset) [public] ¶
-
Seek to a byte offset for the next transfer.
offset | the number of bytes to seek forward |
- void allocate(long bytes) [public] ¶
-
Allocate space for a file.
After calling this, append() or put() should be the next command.
bytes | the number of bytes to allocate |
- void get(const(char)[] path, const(char)[] local_file, FtpProgress progress = null, FtpFormat format = image) [public] ¶
-
Retrieve a remote file's contents into a local file.
Calling this function will change the current data transfer format.
path | the path to the remote file |
local_file | the path to the local file |
progress | a delegate to call with progress information |
format | what format to read the data in |
- void enableUTF8() [public] ¶
-
Enable UTF8 on servers that don't use this as default. Might need some work
- void get(const(char)[] path, OutputStream stream, FtpProgress progress = null, FtpFormat format = image) [public] ¶
-
Retrieve a remote file's contents into a local file.
Calling this function will change the current data transfer format.
path | the path to the remote file |
stream | stream to write the data to |
progress | a delegate to call with progress information |
format | what format to read the data in |
- InputStream input(const(char)[] path) [public] ¶
-
- OutputStream output(const(char)[] path) [public] ¶
-