Giter VIP home page Giter VIP logo

Comments (6)

RomainLanz avatar RomainLanz commented on July 26, 2024 2

Hey @annymosse! 👋

This is out-of-scope of this package.
Feel free to use the driver() method in the next release to have access to the real driver behind our abstraction to do what you wanna do.

from flydrive.

annymosse avatar annymosse commented on July 26, 2024 2

Hey, really interested in this feature, @annymosse could you share your solution?

as i had mentioned above i made (before longtime ago since 2019) a mixed solution with other libs such as glob for listing my files in array to do my own stuffs before delete these files recursively & rimraf.

Try to remove a folder with all its content but in an optimized way (not have to recursively delete all files).

As current of time i don't think there's a solution to remove folders with their contents without a recursive method (at least in *Unix OS).

There's ability to fix that old solution and provide a modern feature inside the kernels of these OS , since there's a new languages are planing to replace these old hard languages such as c & c++ with modern syntax and ability to reuse code/libs such as Zig lang, Rust lang and V lang even there's new OS made by rust and v.
Sorry for my delay to reply @Nightbr , and thanks for your interests.

from flydrive.

annymosse avatar annymosse commented on July 26, 2024 1

Hey @annymosse!

This is out-of-scope of this package.
Feel free to use the driver() method in the next release to have access to the real driver behind our abstraction to do what you wanna do.

im using adonis and using driver() but cant get files inside a folder or remove a folder or compress a folder,i solved these features using glob lib and others libs,thanks

from flydrive.

annymosse avatar annymosse commented on July 26, 2024 1

@Nightbr as you can see at the function definition https://github.com/bingtimren/s3-commons/blob/878f0c8c7fae98c5d4b7036f21f549fc902c490d/src/lib/deleteRecursive.ts#L7 even S3 (which use Amazon Linux) there's no modified Linux kernel which let it stuck with recursive method too, however because there's a key value feature (as i know it use hyper-storage for indexing and versioning history data) which is used to index the files and eliminate the need to recursively listing all sub-tree files/folders structures, @Nightbr ,if there's no plan to add remove folders without recursive method into the kernels i think your idea it's the best solution, adding a cache layer such as Redis to keep the structures up-to-date always and remove the folders using that cache without reading the trees each time.

from flydrive.

Nightbr avatar Nightbr commented on July 26, 2024

Hey, really interested in this feature, @annymosse could you share your solution?
Try to remove a folder with all its content but in an optimized way (not have to recursively delete all files).
Thanks 🙏

from flydrive.

Nightbr avatar Nightbr commented on July 26, 2024

For S3 driver, I use this method: https://github.com/bingtimren/s3-commons/blob/master/src/lib/deleteRecursive.ts
And usage is:

    const driver: S3 = this.myDisk.driver();
    const count = await deleteRecursive(driver, this.bucket, id + '/');
    return count;

It will optimize the Bulk delete using deleteObjects.

from flydrive.

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.