https://github.com/maskray/rftp
FTP client and server
https://github.com/maskray/rftp
Last synced: 12 months ago
JSON representation
FTP client and server
- Host: GitHub
- URL: https://github.com/maskray/rftp
- Owner: MaskRay
- Created: 2013-12-29T06:32:48.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-29T06:37:01.000Z (about 12 years ago)
- Last Synced: 2025-01-29T02:27:10.457Z (about 1 year ago)
- Language: C++
- Size: 176 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RFTP
## Features
### Client
- Command line editing with GNU Readline
- Resume of uploading/downloading
- IPv6 (supporting `EPRT`, `EPSV`)
- Active/passive modes
- Multiple log levels
```
% ~/Dev/RFTP/build/ftp -d '[::1]'
<-- 220 ProFTPD 1.3.4d Server (ProFTPD Default Server) [::1]
rftp@::1 >>= ?
All commands: active, cat, cd, cdup, chdir, chmod, connect, close, debug, dir, get, help, lcd, login, list, lpwd, ls, md, mkdir, mv, open, passive, put, pwd, quit, quote, rhelp, rd, rmdir, site, size, ?
rftp@::1 >>= login
Login (anonymous):
--> USER anonymous
<-- 331 Anonymous login ok, send your complete email address as your password
Password:
--> PASS anonymous@
<-- 230 Anonymous access granted, restrictions apply
--> PWD
<-- 257 "/" is the current directory
rftp@::1 / <> /tmp >>= ls
--> EPSV
<-- 229 Entering Extended Passive Mode (|||12408|)
--> LIST
<-- 150 Opening ASCII mode data connection for file list
-rw-r--r-- 1 ftp ftp 9 Dec 27 09:19 a
drwxr-xr-x 2 ftp ftp 4096 Feb 1 2013 distfiles
drwxrwxrwx 12 ftp ftp 4096 Dec 27 09:25 upload
<-- 226 Transfer complete
rftp@::1 / <> /tmp >>= cd upload
--> CWD upload
<-- 250 CWD command successful
--> PWD
<-- 257 "/upload" is the current directory
rftp@::1 /upload <> /tmp >>= get ii -o iii
--> EPSV
<-- 229 Entering Extended Passive Mode (|||47310|)
--> TYPE I
<-- 200 Type set to I
--> RETR ii
<-- 150 Opening BINARY mode data connection for ii
<-- 226 Transfer complete
Transfer complete, file size 0
```
### Server
```
% build/ftpd
FTP server.
Usage: build/ftpd [options] root
Options:
-6, --ipv6 ipv6 (default is ipv4)
-d, --debug
-n, --nodaemon Do not background the process or disassociate it from the controlling terminal
-p, --port listening port
-q, --quiet
-u, --user Change user identity
-h, --help display this help and exit
Report bugs to i@maskray.me
```
## Test
```
% make --no-p test
make -C tests/sock test
echo 5 | socat - tcp-l:9999,reuseaddr &
sleep 0.05
./main
5
hello, world
```