-
Notifications
You must be signed in to change notification settings - Fork 117
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
implement remove and rename feature for fat32 #233
implement remove and rename feature for fat32 #233
Conversation
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.
Overall, this looks great, and thank you.
In terms of naming, are these meant to be restricted just to files, or any structure (files, dirs, symlinks where supported, etc.)? I would think the latter, since CLI-level commands for the above in most OSes don't care. Same for linux mv
/ Windows ren
.
So should these be RemoveFile()
and RenameFile()
, or just Remove()
and Rename()
?
On the other hand, in keeping with golang style, maybe these should parallel and be Remove()
and RemoveAll()
and [Rename()
](https://pkg.go.dev/os#Rename]?
Thanks for the feedback. I will look into your request and test, if the implementation will also work for symlinks and directories. If so, its a good idea to stick to your suggested naming-scheme. Additionally I can check if the RemoveAll is easy to implement, I have to see if I can spare enough time for that feature. |
@ludelion5 sorry to send you on a bit of a U turn. #264 was merged a few days ago, which extends the general interface with support for remove and rename, specifically as |
Sorry for the late update on this PR. We adapted our Rename and Remove methods to the new interface. Additionally we have implemented the ability to remove empty directories and the renaming to already existing files (overwriting). |
filesystem/fat32/fat32.go
Outdated
func (fs *FileSystem) Rename(oldpath, newpath string) error { | ||
return filesystem.ErrNotImplemented | ||
} | ||
|
||
// removes the named file or (empty) directory. | ||
// | ||
//nolint:revive // parameters will be used eventually |
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.
As the method got implemented, lint exception is not needed anymore here. Please remove it.
That certainly is enough for now. We go from "this is not implemented" to "this is partially implemented", which his an improvement. So thank you. |
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 the lint comment.
done |
Just some lint errors that need to be fixed. |
|
Looks great, thanks! |
are you planning to create a new tag as well? |
Yeah but let's wait for this one. |
Do you have an estimation when a new tag is created? |
We can cut one now. We have the extended filesystem interface, this, go 1.22 restored support, some fixed, etc. |
Sorry for the late PR. Here is my proposal to rename and remove files in fat32.
closes #191