[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help Me!! Getting CATALOG into an Array Variable
Intersting. I had no ideas ProDOS would allow that. Back in the DOS33 days
I did it by creating an EXE file that created a text file listing of the
catalog, then read the text file from basic that had the refreshed catalog
in it. One could then count the number of lines and convert it into an
array on disk (RA text file) or simply reread the file (Sequential access)
to get to the entry you'd want by using a loop. (Slow unless in a ram disk.)
I think Mr Empson's approach is better by far except for the question of the
array. Of course with his method, you could easily create a random access
text file and use it as your array. (Read file, offset.) Please pardon my
total lack of syntax and usable code, it has been along time. (C++ screws
up your BASIC and Pascal skills) Again I'd recommend a RAM Disk for faster
access if you use a text file instead of an array. The file has the
advantage of being able to expand and contact as required by
foldersize/number of enties, where an array does not. (Again if I recall
correctly.)
Goto Main
SubReadCat:
read catalog and count entries variable storage of Volume name, path,
number of entries, etc.
Open RA text file, Store count, Reread Catalog and store file name
entries, close RA text file
return
Main:
Gosub SubReadCat
usefull program end
Another useful thing might be to acutally use ProDOS calls to read the
catalog itself. Ultimately that is what I did in one of my programs, I
accessed the RWTS part of DOS33 to read tha catalog secotors directly. I
would use the RWTS to pull a secor of catalog into memory and read/ change
the entries and write it back out. (Great for making illegal file names. :)
Thankx,
Ed
David Empson wrote:
>
> Note that you have to be careful with the array size. 51 is sufficient
> for a root directory (assuming a disk which follows the standards), but
> there is no limit on the size of a subdirectory.
>