Skip to content
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

Add remove_save method to delete existing save data #750

Merged
merged 2 commits into from
Jan 27, 2022

Conversation

Blackhawk-TA
Copy link
Contributor

@Blackhawk-TA Blackhawk-TA commented Jan 26, 2022

Currently it is not possible to delete existing save files, therefore I added this functionality to the api.

Waiting for #749 to be merged.

@Blackhawk-TA Blackhawk-TA changed the title Add remove_save method to delete existing save data Draft: Add remove_save method to delete existing save data Jan 27, 2022
@Blackhawk-TA Blackhawk-TA marked this pull request as draft January 27, 2022 01:16
@Blackhawk-TA Blackhawk-TA changed the title Draft: Add remove_save method to delete existing save data Add remove_save method to delete existing save data Jan 27, 2022
@Gadgetoid Gadgetoid marked this pull request as ready for review January 27, 2022 13:27
@@ -182,7 +182,13 @@ bool rename_file(const std::string &old_name, const std::string &new_name) {
}

bool remove_file(const std::string &path) {
return remove((basePath + path).c_str()) == 0;
// check if the path is under the save path and do not add basePath if this is the case
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be unnecessary, since the generic "remove_file" probably still wants to be able to delete things from / (firmware/launcher updates for example)

@Gadgetoid
Copy link
Contributor

Should be no need to change remove_file since that should be generic and not know/care about the save directory.

We have no pretense of filesystem safety here 😆

@Gadgetoid Gadgetoid merged commit 1823ed4 into 32blit:master Jan 27, 2022
@Gadgetoid
Copy link
Contributor

Thank you!

@Blackhawk-TA Blackhawk-TA deleted the remove-save branch January 27, 2022 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants