Comments (6)
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.
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.
Hey @annymosse!
This is out-of-scope of this package.
Feel free to use thedriver()
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.
@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.
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.
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)
- Cannot find module 'aws-sdk' when trying to use only gcs driver HOT 5
- fs-extra has no default export HOT 1
- Types are not available on typescript
- Support for make public HOT 8
- Latest version doesn't work. HOT 2
- Type differences in Readable HOT 3
- How to get registered drivers HOT 3
- Add createWriteStream() method support HOT 2
- Add license.md file
- UnexpectedParameter: Unexpected key 'Expiry' found in params HOT 1
- [FeatureRequest] Return file size when using a stream.
- FTP driver
- Does support for making directories exist? HOT 2
- fs_1.promises.opendir is not a function HOT 4
- Set subfolder as bucket root HOT 1
- S3 flatlist Delimiter HOT 2
- S3 copy
- Problems with S3 URL generation HOT 2
- flatList doesn't work with local storage HOT 1
- Is this repo is still alive HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flydrive.