Code Monkey home page Code Monkey logo

Comments (3)

azihassan avatar azihassan commented on September 26, 2024

I've been toying with the idea of displaying progress bars (with \r) while the files are being copied or moved. Not sure if this is necessary, but it would be nice to have.

OK maybe not a progress bar, just a progress percentage like this :

$ ctrl -V
Copying /home/ctrl/foo to /tmp/foo [50% | 175 KB / 350 KB]

Then when it finishes, it displays [100% | file size / file size] and moves on to the next file :

Copying /home/ctrl/foo to /tmp/foo [100% | 350 KB / 350 KB]
Copying /home/ctrl/bar to /tmp/bar [...]

This could be a decent compromise between a full blown progress bar and a binary DONE/NOT DONE progress report.

Writing tests for this should be interesting

I'm also not sure how well it's gonna work on Windows

from ctrl.

azihassan avatar azihassan commented on September 26, 2024

I did some digging and realized that in order for there to be a progress bar, the copy and move functions of the filesystem module should support this feature. Right now though they're only thin wrappers around std.file.copy and std.file.move respectively, which don't report progress. This leaves me with two choices :

  • Call copy in the background, then somehow track the progress in the foreground
  • Write my own version of copy and move that report progress, using std.stdio.File under the hood

from ctrl.

azihassan avatar azihassan commented on September 26, 2024

Implemented a basic status reporting of OK/Failed, I'll close this issue for now until I can work on the real-time progress functionality.

from ctrl.

Related Issues (18)

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.