Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.
/ TinyOne Public archive

A simple FTP server implement by C.

Notifications You must be signed in to change notification settings

i0Ek3/TinyOne

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyOne

A simple FTP server implement by C.

Basic Introduction

  • File Transfer Protocol
  • Working in the application layer of the TCP/IP protocol family
  • FTP will establish two connections, separate the command from the data
  • Transfer file model
    • PORT: client -> PORT -> server, port > 1024
    • PASV: client -> PASV -> server, port < 1024

FTP Process

  • Launch FTP
  • Establish control connection
  • Establish a data connection and transfer files
  • Close FTP

Socket Programming Process

  • Socket Client
    • use socket() to create a Socket
    • use connect() to connect server
    • use write() and read() to communicate with each other
    • use close() to close Socket
  • Socket Server
    • use socket() to create a Socket
    • use bind() to bind Socket
    • use listen() to listen Socket
    • use accept() to recieve request
    • use write() and read() to communicate with each other
    • use close() to close Socket

Architect

.
├── README.md
├── base
│   ├── to_base.c
│   └── to_base.h
├── bin
│   ├── toc
│   └── tos
├── client
│   ├── makefile
│   ├── to_client.c
│   └── to_client.h
├── pic
│   ├── snapshot.png
│   └── structure.png
└── server
    ├── auth.txt
    ├── makefile
    ├── tmp.txt
    ├── to_server.c
    └── to_server.h

How-To

// build
$ git clone https://github.com/i0Ek3/TinyOne
$ cd TinyOne
$ cd client ; make
$ cd server ; make

// run
$ ./tos port
$ ./toc ip port

or run toc and tos directly under /bin.

// login
username: admin   username: admin
password: admin   password: 

//commands
list or ls
get or download
put or upload
quit or q

Snapshot

Issue

  • Execute tos and toc under /bin will appear "No such file or directory" error, cause of server cannot locate auth.txt.

To-Do

  • More commands support
  • Breakpoint resume
  • Server-side synchronization display

References

About

A simple FTP server implement by C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published