|
Arduino TinyFTP
|
FTPFile A single file which supports read and write operations. This class is implemented as an Arduino Stream and therefore provides all corresponding functionality. More...
#include <FTPFile.h>
Public Member Functions | |
| FTPFile (FTPSessionProvider *provider, FTPBasicAPI *api, const char *name, FileMode mode) | |
| size_t | write (uint8_t data) override |
| size_t | write (const uint8_t *data, size_t len) override |
| size_t | write (const char *data, int len) |
| int | read () override |
| size_t | readBytes (char *buf, size_t nbyte) |
| size_t | readBytes (uint8_t *buf, size_t nbyte) |
| size_t | readln (char *buf, size_t nbyte) |
| Reads a line (w/o the end of line character) | |
| int | peek () override |
| int | available () override |
| void | flush () override |
| void | reopen () |
| void | close () |
| Ends the transfer (of all copies) and releases the session. | |
| bool | cancel () |
| Aborts the transfer (of all copies) and releases the session. | |
| const char * | name () const |
| size_t | size () const |
| void | setEOL (char *eol) |
| bool | isDirectory () const |
| operator bool () | |
Protected Member Functions | |
| FTPBasicAPI * | dataSession () |
| FTPBasicAPI * | commandSession () const |
| size_t | readData (Client *in, uint8_t *buf, size_t len, int terminator) |
| Client * | readStream () |
| Starts the download if necessary and provides the data stream. | |
| Client * | writeStream () |
| Starts the upload if necessary and provides the data stream. | |
Protected Attributes | |
| String | file_name |
| const char * | eol = "\n" |
| FileMode | mode = READ_MODE |
| FTPSessionProvider * | provider = nullptr |
| FTPTransferHandle | transfer |
| bool | has_session = false |
| bool | is_open = false |
FTPFile A single file which supports read and write operations. This class is implemented as an Arduino Stream and therefore provides all corresponding functionality.
Copies of a file share the same transfer: the transfer is ended when close() is called or when the last copy is destroyed. A file must not be used after the FTPClient which created it has been destroyed.
|
inline |
File which uses the provided session (if not null): otherwise a session is requested from the provider when the file is accessed
|
inlineoverride |
Provides the number of bytes which can be read. If no data has arrived yet, we wait up to the timeout (see setTimeout()), so 0 is only returned at the end of the file (or on timeout).
|
inlineprotected |
Provides a session for commands (e.g. SIZE): we can not use the session of a running transfer
|
inlineprotected |
Provides the session of the transfer: it is requested from the provider on the first access
Reads up to nbyte bytes: returns less at the end of the file (or on timeout)
|
inlineprotected |
Reads up to len bytes until the terminator (if >= 0, it is not stored): stops at the end of the data or on timeout
|
inline |
Opens the file again after a close(): the next access starts a new transfer