I have a need to check if a file is currently open. Is it OK to do so as indicated below?
lfs_file_t* file;
bool isOpen = ((file->flags & LFS_F_OPENED) == LFS_F_OPENED);
This is a useful check to be made in cases where files are written autonomously and could fail to close before the next attempt to open is made.
LFS defines the LFS_F_OPENED flag as internally used, so I wanted to check if this access was safe, or if there are some conditions when the flag isn't immediately updated.