Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!ptsfa!pbhyd!lc From: lc@pbhyd.UUCP (Larry Colton) Newsgroups: comp.sys.apple Subject: Re: DOS 3.3 Catalog to text file Message-ID: <952@pbhyd.UUCP> Date: Thu, 30-Jul-87 11:50:42 EDT Article-I.D.: pbhyd.952 Posted: Thu Jul 30 11:50:42 1987 Date-Received: Sat, 1-Aug-87 09:49:45 EDT References: <1860@ihwpt.ATT.COM> Reply-To: lc@pbhyd.UUCP (Larry Colton) Distribution: world Organization: Pacific * Bell, San Ramon, CA Lines: 26 Keywords: DIRECTORY PRODOS BASIC In article <1860@ihwpt.ATT.COM> bird@ihwpt.ATT.COM (J.L.Walters) writes: >A few weeks ago there were a number of requests for someone to upload a >program that would catalog a disk and save the result to a text file on a >disk. In answer to that the two programs LABELS and MENU were uploaded. These >programs were to be modified to perform the wanted function. The following is >my version. It is for DOS 3.3 only. It should be possible to modify for >ProDOS (he said confidently). > Nothing special is required to capture a ProDOS directory into an Applesoft array as ProDOS is much more flexible than DOS 3.3 in file handling capabilities. A directory can be opened and read just like any other file by using the ,t argument: PRINT CHR$(4)"OPEN DIR.NAME,TDIR":PRINT CHR$(4)"READ DIR.NAME". It is then a simple matter to INPUT into an array as you would any text file. Since the number of files in a directory can vary, you should DIM the array to the maximum size directory you anticipate encountering (remember there is no limit to the number of files in a subdirectory). You should use an ONERR statement to trap the OUT OF DATA message and exit your input loop when reading directories shorter than your DIM value. Remember to CLOSE the directory when done reading it. --- Larry Colton {ihnp4,pyramid,qantel}!ptsfa!pbhyd!lc Pacific * Bell San Diego