LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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.

Notices

Reply
 
Search this Thread
Old 10-26-2007, 10:03 AM   #1
bjj2282
LQ Newbie
 
Registered: Apr 2007
Posts: 13

Rep: Reputation: 0
Does fwrite() write entire file on jffs2?


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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
grip : no write access to write encoded file bidouilleur Linux - Software 5 10-09-2010 09:23 PM
Redboot - Loading Kernel Image & File Jffs2 MKSrivastava Debian 1 04-21-2007 07:03 PM
Slow file writing with 'fwrite' function in C-code... scho Programming 5 08-07-2006 12:42 AM
tool to write JFFS2 image on CF newbieMhke Linux - Software 1 07-25-2006 09:03 AM
Can't read entire file from CD under RH7.1 t0dd Linux - General 2 01-28-2002 12:40 PM


All times are GMT -5. The time now is 08:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration