Skip to content

Add open function without path #57

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

Merged
merged 1 commit into from
Jun 19, 2025
Merged

Add open function without path #57

merged 1 commit into from
Jun 19, 2025

Conversation

sebromero
Copy link
Contributor

Currently, when creating a file with createFile the file is already open. However if we close the file and later want to re-open it, we'd need to provide the full file path which might be unknown at that moment. e.g.

logFile = storage.getRootFolder().createFile("log.txt", FileMode::WRITE);
logFile.close();        
...
logFile.open("/usb/log.txt", FileMode::APPEND);
logFile.write(message);

This PR adds a function that re-uses the path set by createFile and getRootFolder respectively.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels May 5, 2025
Copy link
Contributor

@cristidragomir97 cristidragomir97 left a comment

Choose a reason for hiding this comment

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

LGTM

@cristidragomir97 cristidragomir97 merged commit fe016fc into main Jun 19, 2025
6 of 12 checks passed
@cristidragomir97 cristidragomir97 deleted the open-func branch June 19, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants