[QUESTION] What is the file state upon power down?
Hi, I understand that power down in middle of file write not corrupts the file system, and that every file that syncd/closed will be exist after the power down.
From my experience, if I open file which creates it and write to it and then power down happens - the file will be exist but without any data. Is this really the case and always? (full revert of any writes done without explicit call to sync, but created files exist although wasn't synced/closed. not matter how much was written and if inline etc.).
If indeed, it is surprising because it mean the file metadata is written twice - upon creation and upon close. And also it is very not convenient as if I see file after power down I need to check if it has content (can't assume that if it exist then its data written already).
The only documentation I found is: https://github.com/littlefs-project/littlefs/blob/adad0fbbcf5382c20978d07f94f9c13be9041c1b/README.md?plain=1#L14-L16 The term 'last known good state' is not clear enough to me