Skip to content

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