Jump to content

[Orange Pi PC+] problem file save


prime_jp

Recommended Posts

Hi.

 

The following happened.

 

When power is suddenly cut off in emmc, the file contents created by fopen (), fprintf (), fflush() and fclose () are not saved after rebooting. It seems that it has not been physically written out while being cached.

 

If display the file before cutting off the power, the contents are correctly saved.

 

In addition, if it is normally reboot it is saved correctly.

 

Link to comment
Share on other sites

This can occurs on any Linux or even on other OS where files a cached and written to disk in background after a certain amount of time.

If you wish to ensure that files are not cache any more, the "sync" command will force the caching to be written on disk.

Power failure will always produce such behaviour, even on PC or Mac.

Link to comment
Share on other sites

martinayotte, Thank you very much.

 

When sync () is described after fclose (), it can operate normally.

Since raspbian was able to operate without problems, I thought whether it was a problem on the system.
It seemed that there was no problem with raspbian, it happened by chance.
 

Link to comment
Share on other sites

It might be that your armbian starts on "virtual read-only" mode. Check that first please. Normally, it should be printed on the screen when you boot your board. In that case all changes are gone after a reboot. You need to run `armbian-config` and disable virtual read-only mode.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines