Giter Site home page Giter Site logo

0x50f13 / pcp Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 119 KB

Pretty copy(shortened pcp) is utility for copying files which aims to provide better UI and more features compared to standard UNIX cp utility.

License: GNU General Public License v3.0

Rust 97.75% Shell 1.34% Dockerfile 0.91%
cargo console console-application copy-files progress-bar rust tokio utility utility-application copy-with-progress alpine crate crates-io cratesio docker docker-image

pcp's Introduction

Pretty copy

Pretty copy(shortened pcp) is utility for copying files which aims to provide better UI and more features compared to standard UNIX cp utility.

showcase

Installing

Cargo

You may use cargo to install pretty-copy crate, though in this case binary would be named pretty-copy, not pcp so you would need to alter name manually:

cargo install pretty-copy
cd /path/to/your/cargo/bin
mv pretty-copy pcp

Arch-based

On Arch distributions you may use AUR helper(e.g. yay to install pretty-copy package):

yay -S pretty-copy

or clone this repository and makepkg:

git clone https://github.com/0x50f13/pcp
cd pcp/pkg
makepkg -si

Others

Currently on other distributions you may download x86_64 binary from releases or build for yourself

Build

For building you need Rust and Cargo. To build clone this repository and use cargo:

git clone https://github.com/0x50f13/pcp
cd pcp
cargo build --release

And then copy resulting file to any of directories from your $PATH:

# Here /usr/bin is just an example
cp target/release/pcp /usr/bin

Usage

Usage: pcp [OPTIONS] <SRCS>... <DEST>

Argument/Option Description
<SRCS>... Source file/directories
<DEST> Destination file/directory
-r, --recursive Copy directories recursively
--no-progress Do not show progress
--fail-fast Fail on first error
--max-chunks-number <MAX_CHUNKS_NUMBER> Maximum number of cached chunks of file stored in memory [default: 1024]
-h, --help Print help

Features

Current

  • Copy files with progress
  • Copy directories

Future

  • Copying files via HTTP and HTTPS protocols
  • Metadata copying(e.g. SELinux labels)
  • Copying files/directories via SCP
  • Copying files/directories via FTP and SFTP
  • Reflinking files when supported
  • Writing directly to devfs, so utility may burn file to drive straight away
  • Calculate directory size before copying it
  • Qt or GTK progress window(or Tcl, or maybe even direct rendering with GL?)
  • Optional plugins support

Development

Documentation

Online

TODO

Generation

Use cargo doc for documentation generation.

Short abstract

The program possess currently 3 dynamical components which have corresponding traits:

  • Reader implements reading files(and their metadata)
  • Write implements writing files
  • ProgressDisplay implements showing progress to user
  • Actually one more is planned: InstantCopyHelper which would help to determine whether file can be instantly reflink'd

The general algorithm is that we have two coroutines and channel between them. One coroutine reads file another one writes to it. The coroutine which writes additionally updates progress which is done synchronously(so in future UI thread may be added via mpsc channel)

pcp's People

Contributors

0xf104a avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pcp's Issues

Global rc file

Implement $HOME/.pcprc config file for storing global configuration. Maybe useful for #1

Devfs writer

Implement devfs writer which would help in burning images to devices

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.