Azure / azure-storage-net

Microsoft Azure Storage Libraries for .NET
Apache License 2.0
446 stars 371 forks source link

Delete Directory when not empty #393

Closed aboobolaky closed 7 years ago

aboobolaky commented 7 years ago

Hi, Currently the SDK (File Share) does not allow us to delete a directory if there are existing files in it. The Response is a 409 (Conflict) with HttpStatusMessage being ""The specified directory is not empty.""

At the moment, we have to delete all files and then delete the directory.

Is this feature on the road-map somewhere?

erezvani1529 commented 7 years ago

Hi @aboobolaky,

This feature will not be on the road-map since we generally try to keep the number of operations per API and REST calls at the minimum. Providing such functionality will require an unknown number of underlying operations per a single delete directory call which is not desireable as explained.

Thanks!

ekelmans commented 4 years ago

you gotta be kidding me....

So i have a tree with 40.000+ folders and over 3.000.000 files, and those need to be deleted on a per item basis ?

amnguye commented 4 years ago

Hi @ekelmans,

Sorry for the inconvience. Yes, you would have to write up some code to recursively walk though the filesystem folder and delete all the files and subdirectories (of course all the files/folders within the subdirectory has be deleted first).

ekelmans commented 4 years ago

Pity…. 😊

Any chance on this feature being implemented in the future? Or being able to delete a folder without first having to delete a all files in that folder?

Met vriendelijke groet,

Theo Ekelmans Sr. MS-SQL DBA

Ringwade 1 3439 LM Nieuwegein T +3130 663 7000 M +316 2127 4593 http://www.ordina.nl/ www.ordina.nl

Van: Amanda Nguyen notifications@github.com Verzonden: maandag 9 december 2019 19:23 Aan: Azure/azure-storage-net azure-storage-net@noreply.github.com CC: Theo Ekelmans theo@ekelmans.com; Mention mention@noreply.github.com Onderwerp: Re: [Azure/azure-storage-net] Delete Directory when not empty (#393)

Hi @ekelmans https://github.com/ekelmans ,

Sorry for the inconvience. Yes, you would have to write up some code to recursively walk though the filesystem folder and delete all the files and subdirectories (of course all the files/folders within the subdirectory has be deleted first).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-storage-net/issues/393?email_source=notifications&email_token=AIBPH4RFEQ5JJVE45NGPSWLQX2EHRA5CNFSM4C4BPMPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGKEVBQ#issuecomment-563366534 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBPH4W3ZEXQ7AP32FMLJUDQX2EHRANCNFSM4C4BPMPA . https://github.com/notifications/beacon/AIBPH4WMXQTEPDRN6K2GQ7TQX2EHRA5CNFSM4C4BPMPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGKEVBQ.gif

amnguye commented 4 years ago

Hi,

For version 11 of the .NET sdk, we don't look to support a feature like this. A new version of the .NET sdk was released recently, so I encourage you to submit an issue in that repo so that it can get picked up in the new version.

https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/storage https://github.com/Azure/azure-sdk-for-net/issues

yonidaniel commented 4 years ago

@ekelmans,

Have the same problem It will be very helpful to have a "normal" delete folder instead of having recursively go through all the folders.

If someone has any other solution please share.

avj-vaibhav commented 11 months ago

Hello, even I'm facing the same problem. Do we have the feature to delete a Non-Empty Directory yet ?

Please share any updates on the above feature.