[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ProDOS Plus
In article <46893ef2$0$14098$742ec2ed@news.sonic.net>,
Andy McFadden <fadden@fadden.com> wrote:
> mdj <mdj.mdj@gmail.com> wrote:
>>> Sparse files were available already in Apple DOS 3.3 as well as in CP/M-80,
>>> both of which predated ProDOS.
>>
>> Curious. I never saw one in DOS 3.3, and didn't do a lot with CP/M.
I found out about sparse files in CP/M "the hard way" during my first
days with CP/M: I created a small database as a random access
binary(*) data file, and a lot of records were unwritten in that
database file. Later I tried to back up the database file by just
copying it with the standard PIP utility program of CP/M to another
disk. The copy operation appeared to work without problem, but later
I found out that some of the data was missing from the copy!
Actually, no data after the first "hole" in the file allocation was
copied, since PIP silently assumed it had encountered the end-of-file
when it encountered the first "hole" in the file allocation. I didn't
know much about sparse files back then, so it took me some time to
figure out what was happening. A quick'n'dirty fix of the backup
problem was to make a disk copy rather than a file copy to create a
backup.
(*) Note that the CP/M file system is "typeless", just like the file
systems of MS-DOS, Windows, and Unix. Yes, there are those file
"extensions" but they're merely a convention - the OS doesn't prevent
you from accessing an executable file as if it was a data file. Therefore
in CP/M a "binary file" is merely a file containing any binary data, as
opposed to Apple DOS where a "binary file" is of type "B" and is
supposed to have a specific format (program start address and length in
the beginning of the file), containing an executable machine language
program.
> Random-access text files can be sparse.
If you access Apple DOS through the File Manager API, any file type can
be a sparse file. Of course creating e.g. an Applesoft file which is
sparse won't be useful and may just give you problems. So from the
Apple DOS command level, the only sparse files which can be created
are text files.
The FID utility program which came with Apple DOS 3.3 did a proper job
of copying files also for sparse files: all pieces of the sparse file
were copied.
> For example, in the CiderPress
> tutorial sample disk image (an 800K disk with a DOS partition), there's a
> sparse file called "RANDOM:L128":
>
> Name Type Auxtyp Modified Format Length
> ------------------------------------------------------------------------------
> TestFiles DIR $0000 17-Jan-03 19:27 ProDOS 512
> TestFiles:SPARSE NON $0000 11-Jan-03 16:24 ProDOS 16777215
> TestFiles:EMPTY.SPARSE NON $0000 11-Jan-03 15:54 ProDOS 43969
> TestFiles:EMPTY.SPARSE.R NON+ $0000 11-Jan-03 15:51 ProDOS 6844
> [...]
> _DOS001:RANDOM:L128 TXT $0000 [No Date] DOS 384030
>
>
> I hadn't realized that was possible until I had to implement them. :-)
--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://stjarnhimlen.se/