-
Notifications
You must be signed in to change notification settings - Fork 93
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
Adding Delete in IFileSystem #2072
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,5 +217,11 @@ public interface IFileSystem | |
/// The name of the empty directory to remove. This directory must be writable and empty. | ||
/// </param> | ||
void DeleteDirectory(string path, bool recursive = false); | ||
|
||
/// <summary> | ||
/// Deletes a file from a specified path. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have been copying this documentation from Microsoft online docs, here: https://docs.microsoft.com/en-us/dotnet/api/system.io.file.delete?view=netcore-3.1 So, summary: "Deletes the specified file.", param: "The name of the file to be deleted. Wildcard characters are not supported." #Closed |
||
/// </summary> | ||
/// <param name="path">File System path of file to delete</param> | ||
void DeleteFile(string path); | ||
} | ||
} |
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.
Generally, we want these names to match the corresponding system API. In this case, we have a problem: Delete is shared as a name between multiple types. I suggest that we prefix Delete with that enclosing type name. So this method s/be named 'FileDelete' and the one preceding it s/be named 'DirectoryDelete' #Resolved
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.
Should we rename the method CreateDirectory as well?
In reply to: 496997632 [](ancestors = 496997632)
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.
Well, yes, to be consistent,this looks right. I think that also means we need to rename 'Create' to 'FileCreate', since it maps to File.Create? Nice catch!
In reply to: 497004102 [](ancestors = 497004102,496997632)
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.
just updated both
In reply to: 497005275 [](ancestors = 497005275,497004102,496997632)