[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: output redirection



David Empson <dempson@actrix.gen.nz> wrote:
> This is an example of the method under ProDOS.
>
> In effect, reading the catalog gives you a mirror image of the catalog
> as it would normally be displayed in 80-column mode, except that one of
> the blank lines normally displayed at the top of the catalog is missing.
> I forget whether it is the one between the pathname and title line or
> the one between the title line and the first file line - the following
> code assumes the catalog title follows immediately after the pathname
> line.  (If I got it wrong, then swap lines 70 and 80.)
>
> Note that you don't need to use PR#3, because reading the catalog with
> this method will always give you an 80-column catalog listing.
>
> 10 d$=chr$(4): f$="/pathname/of/folder": t$="catalog.txt"
> 20 print d$;"open ";f$;",tdir"
> 30 print d$;"create ";t$;",ttxt"
> 40 print d$;"open ";t$
> 50 print d$;"read ";f$
> 60 input a$: rem pathname
> 70 input c$: rem catalog title
> 80 input b$: rem blank line - discarded
> 90 print d$;"write ";t$
> 100 print a$: print: print c$: print
> 110 print d$;"read ";f$
> 120 dim l$(50)
> 130 n = 0
> 140 input l$: rem file line
> 150 if l$ = "" then goto 200: rem no more file lines
> 160 l$(n) = l$
> 170 n = n + 1
> 180 if n <= 50 then goto 140
> 190 gosub 500: goto 130
> 200 if n > 0 then gosub 500
> 210 input s$: rem summary line
> 220 print d$;"write ";t$
> 230 print: print s$
> 240 print d$;"close"
> 250 end
> 500 rem Flush the array
> 510 print d$;"write ";t$
> 520 for i = 0 to n: print l$(i): next
> 530 print d$;"read ";f$
> 540 return

David,
I ran your program, and even ran it with lines 70 and 80 swapped, but it
only captures the first filename from a directory, to the
"catalog.txt" file, and stops right there.
Can you try it yourself, either on a real Apple II or an Apple II emulator
program.  What I have been doing for now is manually typing the exact
output of a "catalog" command in a text editor, and saving it to a file :)
While this works, albeit the long way of doing it, I would like to get
your basic program working, as some disks I have contain over 50 files.
Thanks.

-- 
William D. Katz "a good skier"

Internet: druid@dorsai.org
Internet: wkatz@nyx.net