Giter Club home page Giter Club logo

Comments (4)

Evizero avatar Evizero commented on August 23, 2024

There is an argument to be made that this can already be achieved by adding an rm instruction to the post_fetch_method. So in a sense this proposal is more about a convenience addition.

from datadeps.jl.

Evizero avatar Evizero commented on August 23, 2024

Actually, now that I think about it the following isn't that bad and it works. Also, looking at the code for rm it seems cross platform.

post_fetch_method = file -> (run(BinDeps.unpack_cmd(file,dirname(file), ".gz", ".tar")); rm(file))  

I'll leave this issue open in case you have some opinion on this. otherwise feel free to close

from datadeps.jl.

oxinabox avatar oxinabox commented on August 23, 2024

I was thinking about something similar to this initially.
I think you are right and that this is something that should have.

The way I was initially thinking of doing it was by including a helper a function: rm_after(fn) = file -> (fn(file); rm(file)).
Which is a specific case of your solution.

Related would be to allow post_fetch_method to take a iterator of commands and then run all of them.
Which is what Flux does for it's callbacks.
Problem there is that we already allow it to take a iterator, because of handling recursive structures.
and that would be ambiguous.

Another would be to include a helper a function like doall(xs...)= file-> foreach(xs(file), xs)

Yet another option would be to include helper functions, like:
extract(file) = run(BinDeps.unpack_cmd(file,dirname(file), ".gz", ".tar"))
which would have a partner
extract_and_rm(file) = (extract(file); rm(file))
which I think would be useful.

from datadeps.jl.

oxinabox avatar oxinabox commented on August 23, 2024

Done>
via the inclusion of an unpack method, that has an option to no delete the orginals.

from datadeps.jl.

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.