Code Monkey home page Code Monkey logo

Comments (5)

Byron avatar Byron commented on June 17, 2024 1

Definitely CC @piotrwach :).

from dua-cli.

Byron avatar Byron commented on June 17, 2024

That would be interesting for some use-cases for sure and quite straightforward to implement I presume if one uses standard Rust serialization.

from dua-cli.

gosuwachu avatar gosuwachu commented on June 17, 2024

@lachesis Can you describe your use case? It would help prfioritize this issue.

from dua-cli.

CouldBeThis avatar CouldBeThis commented on June 17, 2024

Not that anyone asked me but I do occasionally use pdu's --json-output and --json-input to save and load results. You can produce different visualizations for the same data.

My main simple use case is that I have a bunch of old spinning HDDs connected to a low resource computer. I added HDDs slowly over time as I needed space so there was no scheme of what files were where. Too chaosy. So it was required to learn how space was being used then plan a way to move things around.

  • Takes a long time even in rust so in this way I can set a task to collect the data then come back and sort through it later.
  • Don't have to keep a terminal/ssh/tmux or any other kind of session active to preserve the information
  • If you close a window you don't have to start completely fom scratch as I did on a few occasions.
  • The json files can be moved to a better computer which is more pleasant to work on.

It's kind of like using locate instead of find. locate periodically creates a database then lets you very quickly search through it, whereas find starts from scratch every time. If your file-set is relatively stable the speed can be an acceptable trade off.

And since it's json I guess you can do all kinds of things with it.

I think it would be cool if dua could do this because it's the one I like the best but tbh it is also acceptable to use the other available tools. As an intermediary, loading the jsons generated by pdu would be cool because dua does a much superior job of visualizing. But only once in a very long while with a very specific use case.

from dua-cli.

piotrwach avatar piotrwach commented on June 17, 2024

I also have few use cases where having ability to load a file system walk from a file would be very useful:

  1. I work with remote machines where I don't want to run dua. I could instead run some shell command that would list all the files that I could then load in dua on my machine. E.g.
$ ssh remote_host find /home -ls > listing.txt
$ dua i --from-file listing.txt
  1. I sometimes need to analyse what is taking space in my Amazon S3 bucket. For that I would like to run something similar as in 1) e.g.
$ s3cmd ls --recursive "s3://mybucket/*" > listing.txt
$ dua i --from-file listing.txt

Unfortunately the formats of listing.txt in both cases are quite different:

find:

$ find . -ls
19692507        0 drwxr-xr-x    7 pwach            staff                 224  9 Nov 07:39 .
19692508        8 -rw-r--r--    1 pwach            staff                1000  9 Nov 07:39 ./1000bytes
19692511        0 drwxr-xr-x    3 pwach            staff                  96  9 Nov 07:39 ./empty-dir
19692512        0 -rw-r--r--    1 pwach            staff                   0  9 Nov 07:39 ./empty-dir/.gitkeep

vs

s3cmd

$ s3cmd ls --recursive "s3://mybucket/*"
2019-06-14 17:08         123  s3://mybucket/a/1.png
2019-06-15 17:08         456  s3://mybucket/b/2.png

For what it is worth, I have changed dua to achieve 2) already, but since it is not universal / probably a bit out of scope of this project I think we need more universal way of doing this.

from dua-cli.

Related Issues (20)

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.