NU092254@NDSUVM1.BITNET (Brian Dall) (05/13/87)
>From: CC004019@BROWNVM.BITNET (Christopher Chung) >Is there any way to getting the CATALOG command to direct its output >to a text file instead of the screen? I want to be able to create >a text file listing all the files on a disk. Is this possible? Is >there an easy way to do this? Or to read a catalog into an array, for use by a program? I saw the ad for amperworks posted earlier, but I would just like to see a short routine that will allow me to do this. Amperworks would be overkill. Could someone POST a sample routine that would do either of the tasks above? I'm sure there are more than just 2 of us that would be interested in such useful routines. -Bri ________________________________________________________________________ Brian Dall | |"It is dangerous to tell PO Box 5112 | NU092254@NDSUVM1.BITNET | the people that laws are NDSU Station | | not just. . . ." Fargo, ND 58105 | | -Blaise Pascal
BHUBER@ECLA.USC.EDU (05/20/87)
Although this probably won't help you, if you had a II-GS machine with the Orca/APW shell, then redirection makes your request a trivial matter. A command level entry such as CAT /HARD > /HARD/FILENAME would put a copy of the catalog of the root directory HARD into a file called FILENAME. Bud
OAF.G.PELLER@OZ.AI.MIT.EDU (Adam Peller) (05/23/87)
Message-ID: <12304519966.64.OAF.G.PELLER@OZ.AI.MIT.EDU> To get the output from the catalog command (in ProDOS) you just open the pathname as a DIR file... for example: 10 print chr$(4);"open /users.disk,tdir" 20 print chr$(4);"read /users.disk,tdir" 30 get a$:print a$; 40 goto 30 50 end (this would read the directory char by char and put it on the screen - you'd probably need some kind of error-trapping for end of file too...) 5 onerr goto 50 ! very BASIC This will also work for subdirectories, but only in prodos. If you want a catalog in DOS 3.3, there are two ways and neither is as easy as the program above... You'd either have to read the screen (w/strange text storage at $400-$7ff, or you'd have to read the raw sectors at track $11 with a RWTS subroutine (see DOS 3.3 manual) good luck, Adam Peller ADAMP%OZ@MC.LCS.MIT.EDU (Arpa) -------