testing for corruption

Kenneth Brody kenbrody at bestweb.net
Fri Feb 1 07:30:45 PST 2008


Quoting Scott Nelson (Thu, 31 Jan 2008 19:33:54 -0800):

> We had a file get corrupted while changing the map, even though all the
> keys were restructured successfully.  The suspected culprit is a posting
> report that is a cron job, but we are still looking into it.

The only way such a report could have run is if someone removed the
lockfile while the restructure was running.

>   To assist
> in repairing the fields affected, I want to test each record and the
> fields by detecting the garbage graphic characters that appear in the
> fields.  I seem to remember that this can be done with ascii or chr
> codes and a range to see if the values are not 0-9 or a-z.

If you know everything that should be in the field is in the range of
printable ASCII characters, create an edit that only accepts these
characters:

     { " "-"~" }

As I recall, there is an ASCII edit included in the global edits that
does this.

Pass the field through the edit, and if the result is blank (and the
original field is not), then there are non-ASCII characters in the
field.  Actually, simply compare the result with the original, and
if they are not equal, then the field contains non-ASCII characters.

-- 
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list