file_transfer 0.1.1

Enum to transfer files
Documentation
  • Coverage
  • 37.5%
    3 out of 8 items documented3 out of 6 items with examples
  • Size
  • Source code size: 5.09 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 278.68 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • hwseward/FTP
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hwseward

Features

  • Send and Receive Files over TCP

Installation

  • use as cargo dependency
[dependencies]
file_transfer = "0.1.0"

Usage

  • host_main.rs
use file_transfer::FTP;
use std:fs::File;

fn main() {

    // creating new FTP obj with the paramaters of ip:port and the file that you want to write from received file
    let ftp = FTP::new("127.0.0.1:8080", File::create("example1.txt"));
    // Receives file from client
    ftp.recv();

}
  • client_main.rs
use file_transfer::FTP;
use std::fs::File;

fn main() {

    // Creates new FTP object with paramaters of ip and the file you want to send
    let ftp = FTP::new("127.0.0.1:8080", File::open("example.txt"));
    // Sends File
    ftp.send();

}