|
Robert Murrell
|
Partial files being create?
|
|
Robert Murrell
08/12/2011 10:13 AM
post88066
|
Partial files being create?
I found an unexpected and disturbing issue relating to the QNX 4 file system. When writing to a file, and then powering
down during the write, on powerup a partial file is created! I was expecting the file name to be present, but with a
zero length. I would expect that NONE of the data written to the file would be committed until the file was closed.
Unfortunately, my program was writing to /.boot at the time of the powerdown. On repowering, the IPL finds the image
signature in the first 8Kbytes, thinks its good, loads and executes it.
In our application, the system must be tolerant of unexpected powerdowns. I'm developing under QNX 6.5.0 and using the
low-level C open-write-close functions. Is there a way to prevent partial files under this condition?
|
|
|
|
|