FTP library (pc_ftp)
Description:
PocketC native library implementing FTP client functions.
Palm devices with OS > 2.0, PocketC compiler (embedded or Desktop Edition).
Shareware.
Files included:
pc_ftp.prc: the native library. Install it on your Palm device using PalmDesktop tool.
pc_ftp.lib: Lib file for PocketC desktop edition.
pc_ftp.html: this file.
Usage:
On the top of your code place the line :
library "pc_ftp"
Functions:
ftp_netopen();
Open network. Returns 0 on succes or an error code if failed.
Errors thrown: 1001, 1002, 1003, 1004.
ftp_netclose();
Close network.
ftp_connect(string server, int port, string user, string password);
Connect to ftp server. Returns 0 on succes or an error code if failed.
Errors thrown: 1010, 1011, 1012, 1014, 1100.
ftp_close();
Disconnect from server.
ftp_dir();
DIR command. Returns a string containing the result of the command (listing or error).
If the result of the DIR command is bigger than 1024 chars the result is empty string.
In case of failure returns error code in string.
Errors thrown: 1010, 1015, 1012, 1018, 1020, 1100.
ftp_dir_file(string filename);
DIR command with a specified file name. If file exist returns file details.
If not found returns empty string.
In case of failure returns error code in string.
Errors thrown: 1010, 1015, 1012, 1018, 1020, 1100.
ftp_cd(string directory);
CD command. Returns 0 on succes or an error code if failed.
Errors thrown: 1010, 1012, 1015, 1017, 1100.
ftp_pwd();
PWD command. Returns current directory or an error code.
Errors thrown: 1010, 1012, 1015, 1100.
ftp_net_timeout(int timeout);
Change the timeout used in network calls, in system ticks.
The default is 1500 (15 seconds at 100 system ticks per second).
ftp_put(string filename);
Upload filename to server. Handles both .prc and .pdb files,
adding the correct extension to the filename.
Errors thrown: 1010, 1012, 1015, 1018, 1021, 1022, 1023, 1100.
ftp_mkd(string directory);
Make directory. Returns 0 on succes or an error if fails.
Errors thrown: 1010, 1012, 1015, 1024, 1100.
ftp_rmd(string directory);
Remove directory. Returns 0 on succes or an error if fails.
Errors thrown: 1010, 1012, 1015, 1025, 1100.
ftp_del(string filename);
Delete filename. Returns 0 on succes or an error if fails.
Errors thrown: 1010, 1012, 1015, 1026, 1100.
ftp_get(string filename);
Download filename (.prc or .pdb). Returns 0 on succes or an error if fails.
Errors thrown: 1010, 1012, 1015, 1018, 1021, 1027, 1028, 1100.
ftp_ver();
Returns library version, as a 4 chars string. Ex: 101u.
First 3 chars is version number and the forth can be d - developer version
or u - user version.
ftp_reg(string devkey);
devkey: key for registering, obtained on purchasing the developer version.
Register the library (remove the nag alert), must be the first function called.
Works only on developer version (library installs on unlimited number of devices),
does nothing in the user version (library installs on only one device).
Errors :
1001 ROM Incompatible
1002 Net.lib not found on device
1003 Cannot open network
1004 Network interface error
1010 Network not available
1011 Cannot connect to host
1012 Failed to get response from server
1014 Login error
1015 Not connected
1017 CWD failed
1018 Cannot build DATA connection
1020 Error listing directory
1021 TYPE failed
1022 STOR failed
1023 Upload failed
1024 Make directory failed
1025 Remove directory failed
1026 Delete file failed
1027 RETR failed
1028 Download failed
1100 Out of memory
Other network libraries for PocketC
Socket library (pc_sock)
SendMail library (pc_smail)
Copyright Cosmin Buhu, 2002-2003
http://www.easyvitools.com/palm
cosminb@warpnet.ro