aws / aws-sdk-net

The official AWS SDK for .NET. For more information on the AWS SDK for .NET, see our web site:
http://aws.amazon.com/sdkfornet/
Apache License 2.0
2.05k stars 853 forks source link

.Net Standard not exists S3DirectoryInfo class #1461

Open TangGaoHui opened 4 years ago

TangGaoHui commented 4 years ago

When I was developing NETCORE, the S3DirectoryInfo class could not be found. When is it expected to be supported?

klaytaybai commented 4 years ago

Thanks for the request. I'll see if we can get this in soon.

normj commented 4 years ago

We don't currently have any plans to put that feature in the .NET Standard version of the SDK. The reason is in .NET Standard all operations to services are async only but S3DirectoryInfo and all of the other classes in the Amazon.S3.IO namespace would have to have async variations for all of the APIs which would be a large undertaking and we don't have a plan on when we would do that work.

To help with prioritization how critical is this feature for you? Is it a nice to have or you can't move to .NET Core till we have this feature or somewhere in between.

AndrewZu1337 commented 4 years ago

@normj . I'm also trying to use SDK in NetCore project to manage files in buckets. I need the MoveTo (move file from bucket to other bucket) method that is in S3FileInfo class, but there isn't in netcore version :(

alex-jitbit commented 2 years ago

This is critical for us, so we can delete big directories in S3. Not just us, many people use for this very functionality: https://stackoverflow.com/questions/33017858/delete-a-folder-from-amazon-s3-using-api

AdamCoulterOz commented 2 years ago

@normj accepting PRs ?

normj commented 2 years ago

I would hold off on a PR. We are in early design phase of some major work we want to do with the SDK that would affect this feature.

AdamCoulterOz commented 2 years ago

@normj how would you recommend I go about opening a write stream to an S3 blob in the mean time?

MarcoMedrano commented 2 years ago

2022 Could not find S3FileInfo in the AWS SDK for dotnet core.

beeradmoore commented 1 year ago

Bing chat surfaced the S3FileInfo class for me which seemed great for my .NET 6 lambda. But after and some digging I ended up here and can see that it is not a thing yet.

RobK410 commented 1 year ago

Note, I am working on a File/Directory abstraction for S3, and in seeking out a prior abstraction within the SDK, I found the S3.IO namespace, and this commentary. I will be implementing a version where the .NET Core Async calls are executed synchronously using my extension AsyncHelper.RunSync method.

If I were SDK team, I would create Async methods in S3.IO classes to support .NET and change existing blocking sync versions of the methods to use the blocking helper (e.g., link above) technique to support existing sync methods.

tudor-turcu commented 1 year ago

The lack of this class in .NET Standard and .NET Core is a major impediment in migrating code using AWS and .NET Framework to .NET Core.. Indeed, there are alternatives, but all involve a lot of rewrite.

normj commented 1 year ago

Out of curiosity for those asking for the S3 directory classes what version of .NET are you targeting? One of the things we are debating is since starting with .NET 5 .NET added back the sync code path in the Http Client we could add the sync service API for users targeting .NET 6+. If we did that we could make the S3 directory code be part of the .NET 6+ pretty easily.

beeradmoore commented 1 year ago

Targeting .NET 6. Didn't jump to .NET 7 with the help of bootstrap/layers/whatever else we needed to do. When .NET 8 is available in Lambda we will be jumping to .NET 8.

tudor-turcu commented 1 year ago

@normj - for now we must target .Net Standard 2.0 in a library referenced from another .Net Framework 4.7.2 project, and this scenario does not work. In the future in several months or a year we hope to migrate that project to .Net (Core) 6, being the LTS version, but the project using AWS SDK will continue to target .Net Standard 2 (not 2.1).

pillad3 commented 6 months ago

We would also benefit from both the sync overloads of the SDK methods, as well as the S3 directory info class. Having a stream we can write to would remove some complexity in our code. We are currently on .NET 8.

tudor-turcu commented 1 week ago

Any news about this? For many projects it could be a major impediment in migrating from .NET Framework to .NET Core, without a rewrite..