Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am working on an embedded system with a jffs2 partition that will be used for storing and modifying non-volatile data. If I do an fopen() on a file that is in this jffs2 file system, then do an fwrite() on some portion of this file, and then do an fclose() does the entire file get re-written to flash or does just the portion that I wrote to? I am wondering about this because I am worried about flash write cycle lifetime. I realize that jffs2 has wear-leveling, but will that really help if say there are many writes to a small portion of a large file?
Also say that instead of writing directly to this jffs2 file every time I want to write to a file in a tmpfs file system that mirrors that jffs2 file. If I want to update the jffs2 file with the updated tmpfs file, what is the fastest way to do this? I realize that I could just open the tmpfs file for reading and open the jffs2 file for writing and copy byte by byte, but that just doesn't seem very feasible to me. Is there a fast way to compare the two binary files and just write the changes to the jffs2 file?
I hope someone can answer these questions, it would help a lot.