本文共 1090 字,大约阅读时间需要 3 分钟。
轉載自
Q:
Whenever I run my application on UBIFS file system and do a write operation on any file(provided file has proper read and write modes),immediately after power off and on, I see that the content written to the file is missing.The size of the file is zero.The same thing if performed on JFFS2 file system does not pose this issue.I have tried using sync command but still rarely this problem exists.
For example:
I need to write some data in a file called myfile and during run time i open this and write some data as "Hi..Hello.."(if i open the file and check after write operation,data is written properly), then after shutdown/restart, i find that the content "Hi..Hello.." is not there and size of the file is zero bytes.
Note : Problem occurs only after shutdown or restart of the system.
UBIFS does less frequent sync. So if file is important call , In user application you must call fsync(). I suggest you to perform one of the following to prevent data loss in UBIFS:
转载地址:http://twpgi.baihongyu.com/