Welcome,
Guest
. Please
login
or
register
.
June 18, 2013, 02:24:43 PM
The Plug Computer Forum
|
General Category
|
General Discussion
|
File empty after cutting of the power
Pages: [
1
]
« previous
next »
Print
Author
Topic: File empty after cutting of the power (Read 493 times)
JonasR
Newbie
Karma: 0
Posts: 18
File empty after cutting of the power
«
on:
October 26, 2010, 07:49:06 AM »
Hi,
i've got a problem, if I remove the power cord after writing a file and boot the plug again the file is empty. So I'm really sure its a problem with the filesystem(ubifs). I read that it caches the files before writing. So how can I force to write?
Thanks
Logged
MarkF
Full Member
Karma: 7
Posts: 144
Re: File empty after cutting of the power
«
Reply #1 on:
October 26, 2010, 11:22:23 AM »
Before pulling the power, use the "shutdown -h now" command from a shell and it will force a flush of the cache before halting.
From inside a program, I think fsync(handle) done before close(handle) does this.
Logged
Mark
JonasR
Newbie
Karma: 0
Posts: 18
Re: File empty after cutting of the power
«
Reply #2 on:
October 27, 2010, 11:40:28 PM »
Thanks for you reply.
The problem is that some customers wont type in the halt command for shutting it down :/
So I got to take the fsync method. Ill test how to handle this with perl and write it later in here
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> General Discussion
=> Application ideas and development Q/A
=> Success stories
=> Marvell PlugIN - Free Your Imagination
-----------------------------
Hardware and U-Boot firmware
-----------------------------
=> Hardware
=> U-Boot stuff
-----------------------------
Linux Stuff
-----------------------------
=> Android for SheevaPlug is Available!
=> General Linux questions
=> Kernel
=> Linux distributions
Loading...