-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add file and directory renaming #6769
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
Conversation
Internally this is done with a MOVE HTTP verb. It is modeled after WebDAV MOVE but not exact to keep the Destination header shorter and have more consistent response codes. Fixes micropython#6647
If you clear the "rename to" field and then press cancel the file is renamed to null. |
I'm a little disappointed that the edit option has gone away for unknown file types. I know editing a .mpy file didn't make much sense but it didn't crash anything and it was useful to be able to edit files like "menu.bat" or ".env" |
Probably can just add to the known file types as we go though. .env is really the only file type I can think of right know that needs to be added. Although, I guess with a working rename, you can always just add the .txt temporarily onto any file you want to edit and then rename it back... |
Was the lack of any error reporting (target file exists, move to nonexistent folder) intentional? The rename seems to do the right thing in these cases which is nothing :) |
Haha, oops. Thanks for the testing!
This is just the link. You can create the link yourself and the edit page won't be wiser. I did add .env support now.
I'm hesitant to add it because it'll add a lot of strings to the code. We can see what folks say when using it. |
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.
This looks ok by me. _decode_percents
looks like it will give you garbage if the input string is truncated and doesn't have a second character after a %
, but that doesn't really matter, I think.
I will leave use testing to @RetiredWizard.
The null file rename issue is fixed, I've tried to break it everyway I can think of but I think I'm stumped :) |
Internally this is done with a MOVE HTTP verb. It is modeled after
WebDAV MOVE but not exact to keep the Destination header shorter
and have more consistent response codes.
Fixes #6647