-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Name
to IFile.Create
(and others)
#793
feat: Add Name
to IFile.Create
(and others)
#793
Conversation
Name
to IFile.Create
(and others)Name
to IFile.Create
(and others)
Just for reference, there are a few other fields that I am not sure I want to tackle now that we could eventually add here:
(see https://docs.microsoft.com/en-us/dotnet/api/system.io.filestream?view=net-6.0#properties) |
Yes, that's what I had In mind, thanks for taking care! |
/// <summary> | ||
/// A <see cref="Stream"/> that has properties similar to <see cref="System.IO.FileStream"/> | ||
/// </summary> | ||
public class FileStream : Stream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use another name for this to prevent conflicts with System.IO.FileStream
.
I don't have a good idea, maybe FileStreamBase
to mirror other types here?
I think we can ignore |
…umbed in at all because I want to discuss the approach first.
e7c380e
to
461f370
Compare
I think I should add it anyway, since it's just a pass-through property and it's readonly. I'll do that and the other things in the review today, and then I'll start wiring this in. |
Make the following changes for the interfaces: 1. Enable [Nullable reference types](https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references) 2. Improve and cleanup XML documentation and sort properties and methods in interfaces alphabetically 3. Consolidate the naming in the factory methods to always use just `New`; so instead of `new DirectoryInfo(path)` you should use `IFileSystem.DirectoryInfo.New(path)`. The previous existing factory methods were kept and marked as `Obsolete`. 4. Added a `Wrap` method to the factory interfaces that can be used instead of a direct cast (which is not possible for interfaces) to create a wrapped interface from a "System.IO" type. 5. Removed the `WriteAllLinesAsync` with array overload, as it is not defined in `System.IO` and overload resolution will automatically use the `IEnumerable` overload. 6. Added missing methods: `ResolveLinkTarget` and `CreateAsSymbolicLink` 7. Change the return type for Stream-Methods to a custom defined `FileSystemStream`. *Note: This should fix the issues from #793 , right?* Added the following extensibility measures: - Add `IFileSystem FileSystem` property to more classes to enable implementing extension methods. This was simplified by adding a base interface `IFileSystemExtensionPoint` - Add a `IFileSystemExtensibility Extensibility` property on `IFileSystemInfo` and `IFileSystemStream` which grants access to the underlying wrapped instance or to a metadata dictionary to store additional information together with the instance.
I think this pull request could be closed, as it is now implemented as |
I agree. I feel bad I did not get around to getting this PR in when it was needed 😬 |
Added draft implementation of a
FileStream
-like class It is not plumbed in at all because I want to discuss the approach first.@fgreinacher is this kind of what you were thinking in #779 ? I figured if this is correct, I can go through and update all the related
Stream
references to returnFileStream
with theName
property properly set.