
More
about
Splats
One
other
warning-never
scratch a splat file. These are files that show up in a
directory listing with an asterisk
(*)just
before the file type for an entry. The asterisk (or
splat) means that file was never properly closed, and thus there
is
no valid chain
of
sector
links for the Scratch command to follow
in
erasing the file.
If
you Scratch such a file, odds are you will improperly free up sectors that are still
needed by other programs, and cause permanent damage to those other programs later
when you add more files to the diskette. If you find
a·splat file, or
if
you discover too late
that you have scratched such a file, immediately validate the diskette using the Validate
command described later
in
this chapter.
If
you have added any files to the diskette since
scratching the splat file, it
is
best to immediately copy the entire diskette onto another
fresh diskette, but do this with a copy .program rather than with a backup program.
Otherwise, the same problem will be recreated on the new diskette. When the new copy
is
done, compare the number
of
blocks free
in
its directory to the number free on the original
diskette.
If
the numbers match, no damage has been done.
If
not, very likely at least one
file on the diskette has been corrupted, and all should be immediately checked.
Locked Files
Very occasionally, a diskette will contain a locked file; that is one which cannot
be
erased with the Scratch command. Such files may be recognized by the
"<"
character
which immediately follows the file type in their directory entry.
If you wish to erase a
locked file, you will have to use a disk monitor to
clear bit 6
of
the file-type byte in
th
e
directory entry on the diskette. Conversely, to lock a file, you would set bit 6
of
the same
byte. For more information on how such tricks are done, see Chapter 9 and Appendices D
and E.
RENAMING PROGRAMS: BASIC 2
The
Rename command allows you to alter the name
of
a program or other
file
in
th
e
diskette directory. Since only the directory
is
affected, Rename works very quickly.
FORMAT
FOR RENAME COMMAND:
PRINT#l5
,"
RENAMEO:new
name=old
name"
or
it
may be abbreviated as:
PRINT#l5
,"RO:new
name=
old
name"
where
"new
name"
is the name you want the file
to
have, and
"old
name"
is the name
it
has now . " new name" may be any valid file name,
up
to
16
characters in length.
It
is
assumed you have already opened file
15
to
the command channel.
One
caution-be
sure the
file
you are rem.ming has been properly closed before you
rename it.
34
EXAMPLES:
Just before saving a new copy
of
a
''calendar''
program, you might type:
PRINT#
15,' 'RO:CALENDAR/BACKUP
=CALENDAR'
'
Or
to move a program called
"BOOT",
currently the first program on a diskette to
someplace else in the directory, you might type:
PRINT#
15,' '
RO
:
TEMP
=BOOT''
followed by a Copy command (described later), which turns
"TEMP"
into a new copy
of
"BOOT'',
and finishing with a Scratch command to get rid
of
the original copy
of
·•BOOT",
since renamed to
"TEMP"
by the command above.
RENAMING PROGRAMS: BASIC 3.5
The Rename command allows you to alter the name
of
a program
or
other file in the
diskette directory. Since only the directory is affected, Rename works very quickly.
FORMAT
FOR RENAME COMMAND:
RENAME
" old
name"
TO
"new
name"
,Ddrive
#,Udevice
#
where
"new
name"
is
the name you want the file to have, and " old
name"
is
the name
it
has
now.
"new
name"
may be any string expression that evaluates to a valid
file
name,
up
to
16
characters in length.
If
"D"
is left out, drive 0
is
assumed.
If
"
U"
is
absent,
device 8
is
assumed. One
caution-be
sure the
file
you are renaming has been properly
closed before you rename it.
EXAMPLES:
Just before saving a new copy
of
a
''
calendar'' program, you might type:
RENAME
''
CALENDAR''
TO ' 'CALENDAR/BACKUP''
Or
to
·move a program called
"BOOT",
currently the first program on a diskette
to
someplace else
in
the directory, you might type:
RENAME
"BOOT"
TO
"TEMP"
followed by a Copy command (described later), which turns "
TEMP"
into a new copy
of
''BOOT",
and finishing with a Scratch command
to
get rid
of
the original copy
of
"BOOT",
since renamed
to
" TEMP" by the command above.
35
Comentarios a estos manuales