Re: crash during file writing, how to recover ?

From: Roedy Green (see_at_mindprod.com.invalid)
Date: 04/30/04


Date: Fri, 30 Apr 2004 02:44:22 GMT

On Fri, 30 Apr 2004 01:36:56 GMT, Joseph <karloj@bigpond.com> wrote or
quoted :

>Are file writing operations atomic ? ie when you write to a file,
>will it either do it succesfully, OR say half fail (eg write a few letters
>and not finish), OR not commit any changes to the file if a crash at
>this point occurs?

Imagine a floppy being written. The power fails half way through
writing one of your tracks. You then have gibberish on your floppy.
Further the fat and directory are likely out of sync. When you use
CHKDSK /F it tries to fix this. The file contains gibberish. You
probably should bulk erase and reformat such a floppy.

A very easy way to detect the problem is to write small file before
you start. You do your thing, and on exit you erase the file. You
can do this to any app by doing the creating testing and deleting in
bat language.

When you start, you check for the presence of the file. If you see it
you assume the worst, and demand a restore from backup or whatever you
need to do to get going again safely.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming. 
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Relevant Pages

  • Re: crash during file writing, how to recover ?
    ... >will it either do it succesfully, OR say half fail (eg write a few letters ... You then have gibberish on your floppy. ... probably should bulk erase and reformat such a floppy. ... Coaching, problem solving, economical contract programming. ...
    (comp.lang.java.programmer)
  • Re: crash during file writing, how to recover ?
    ... >will it either do it succesfully, OR say half fail (eg write a few letters ... You then have gibberish on your floppy. ... probably should bulk erase and reformat such a floppy. ... Coaching, problem solving, economical contract programming. ...
    (comp.os.linux.development.apps)
  • Re: crash during file writing, how to recover ?
    ... >will it either do it succesfully, OR say half fail (eg write a few letters ... You then have gibberish on your floppy. ... probably should bulk erase and reformat such a floppy. ... Coaching, problem solving, economical contract programming. ...
    (comp.lang.java)
  • Re: OOP/OOD Philosophy
    ... >> solve a problem I have multiple problem solving strategies available: ... you should at least fail "unit" ... and each of these should associate with a user story. ... > very probably fail an acceptance test, and this _will_ associate with a user ...
    (comp.object)
  • Re: OOP/OOD Philosophy
    ... > solve a problem I have multiple problem solving strategies available: ... you should at least fail "unit" ... and each of these should associate with a user story. ... very probably fail an acceptance test, and this _will_ associate with a user ...
    (comp.object)