Skip to content

Commit 0d13784

Browse files
author
delphidabbler
committed
Fix errors and omissions
1 parent d59720e commit 0d13784

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

Docs/Design/FileFormats/backup.html

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ <h2>
7777
</dt>
7878
<dd>
7979
Similar to version 1 except that the 32Kb size limit was lifted (now 2Gb).
80-
Also only for backing up the user database.
80+
Used only for backing up the user database.
8181
</dd>
8282
<dt>
8383
Version 3
8484
</dt>
8585
<dd>
86-
Similar to Versions 1 and 2. Nowused for backing up both the user database
87-
and the main database. An file ID field was added to allows which database
86+
Similar to Versions 1 and 2. Now used for backing up both the user database
87+
and the main database. A file ID field was added to specify which database
8888
was backed up. The file ID generalises to any file.
8989
</dd>
9090
<dt>
@@ -132,7 +132,7 @@ <h2>
132132
<dd>
133133
This file format uses pure binary raw data. The watermark part of the file
134134
header is written in ASCII. File names are stored as UTF-8. All other
135-
information, including file contents is stored as raw binary.
135+
information is stored as raw binary.
136136
</dd>
137137
</dl>
138138

@@ -285,7 +285,6 @@ <h3>
285285
<code>'DBAC'</code> for user database backup.
286286
</li>
287287
</ul>
288-
Other IDs could be used for other backup types.
289288
</dd>
290289
<dt>
291290
<code>FileCount</code>
@@ -371,7 +370,6 @@ <h3>
371370
<code>'DBAC'</code> for user database backup.
372371
</li>
373372
</ul>
374-
Other IDs could be used for other backup types.
375373
</dd>
376374
<dt>
377375
<code>FileCount</code>
@@ -420,13 +418,13 @@ <h2>
420418

421419
<p>
422420
Code that writes backup files should only ever write the latest available file
423-
format at the time the code was written. It should never attempt to write
421+
format at the time the code was written. It musr never attempt to write
424422
earlier versions.
425423
</p>
426424

427425
<p>
428-
Code that restores backup files be able to interpret all earlier formats in
429-
addition to the current one because the program may to restore data from an
426+
Code that restores backup files must be able to interpret all earlier formats in
427+
addition to the current one, because the program may need to restore data from an
430428
old backup file. If the code detects a later version than it was designed for
431429
it should display an error message and terminate.
432430
</p>
@@ -437,9 +435,9 @@ <h3>
437435

438436
<p>
439437
Some earlier versions of the backup restoration code have faults in that they
440-
will attempt to read later backup file versions than thosethey were designed
441-
for. By good fortune factors in the design of later file formats mean that the
442-
reading code always abandons the reading, albeit with no error message. These
438+
will attempt to read later backup file versions than those they were designed
439+
for. By good fortune, factors in the design of later file formats mean that the
440+
reading code always abandons reading later, albeit with no error message. These
443441
problems are:
444442
</p>
445443

@@ -455,11 +453,10 @@ <h3>
455453
</div>
456454
<div class="half-spaced">
457455
The reading code expects backup files to begin with a file count as a text
458-
hex representation of a SmallInt. In file version 2 and later the first
456+
representation of a SmallInt in hex. In file version 2 and later the first
459457
four ANSI chars of the file are <code>'FFFF'</code>, which decodes as
460458
<code>-1</code>. The reader interprets this value as meaning there are no
461-
files in the backup and does nothing, leaving the existing database
462-
intact.
459+
files in the backup and does nothing.
463460
</div>
464461
</dd>
465462
<dt>
@@ -473,7 +470,7 @@ <h3>
473470
In v3 files the file ID is recorded in the same location and same format
474471
as the v2 file format expects to find the file count. Luckily the only two
475472
values in use as File IDs are <code>'CBAC'</code> and <code>'DBAC'</code>,
476-
both of which decode as negative integers. The reader software interprets
473+
both of which decode as negative integers expressed in hex. The reader software interprets
477474
this as meaning there are no files in the backup.
478475
</div>
479476
<div class="helf-speed">
@@ -495,11 +492,11 @@ <h3>
495492
work with file format v3 will also try to read later file versions. It
496493
looks for its file count in a hex encoded SmallInt value at position 12 in
497494
the backup file. File format v4 was designed to have a padding value of
498-
<code>'0000'</code> in this location. Agains this fools the reader software
495+
<code>'0000'</code> in this location. This fools the v3 reader software
499496
into thinking there are no files in the backup.
500497
</div>
501498
<div class="half-spaced">
502-
From CodeSnip v3.8.6 the file reader works correctly.
499+
From CodeSnip v3.8.6 the file reader works correctly and exits with an error when an unsupported backup file version is encountered.
503500
</div>
504501
</dd>
505502
</dl>
@@ -533,7 +530,7 @@ <h3>
533530
File format version 1
534531
</dt>
535532
<dd>
536-
Watermark: <code>''</code>
533+
Watermark: <code>''</code> (empty)
537534
</dd>
538535
<dt>
539536
File format version 2
@@ -558,8 +555,8 @@ <h3>
558555
<p>
559556
It can be seen that the version number at byte offset 4 is not necessary for
560557
identification if the watermark is made longer. However, it should always be
561-
used because earlier versions of the file readers use it to determine which
562-
format is to be read.
558+
used because earlier versions of the file readers may use it to determine which
559+
format version is to be read.
563560
</p>
564561

565562
</body>

0 commit comments

Comments
 (0)