+Larry Posted September 12, 2019 Share Posted September 12, 2019 Before I spend time writing a Basic program to decode the information of a Dos 2.0-type directory, I would think that this has been done many times before. Yet, I haven't found one in my library. Is anyone aware of one? I'd like for it to be Basic so that I can easily modify it, and able to handle SD or DD. Thanks, Larry Quote Link to comment Share on other sites More sharing options...
Rybags Posted September 12, 2019 Share Posted September 12, 2019 I remember doing a shorthand quick/dirty one in the days before i had Dos 2.5XL (which is a hack that allows DUP and MEMSAV to be had in the Ram under the OS). In immediate mode: O.#1,6,0,"D:*.*":F.A=1TO99999:GET#1,D:PUT#16,D:N.A You get Error 136 and the file remains open but it doesn't really matter - type END so the file gets closed if you want. Inside a basic program it's sort of the same. You can use INPUT # to get entire file entries into a string. You should use TRAP so the end of file doesn't get you, though in theory you could probably test for the "FREE SECTORS" text. Quote Link to comment Share on other sites More sharing options...
+Larry Posted September 12, 2019 Author Share Posted September 12, 2019 Thanks, but that doesn't decode the file entry data, does it? Start sector, end sector, total bytes, status, etc. is what I need. Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted September 12, 2019 Share Posted September 12, 2019 Larry, Did you ever get my DIR361 program from about 8 years ago. I thought that I had sent it about the same time I sent the Directory Print program. I will check my older floppies for them if I can find them I will PM you copies. Quote Link to comment Share on other sites More sharing options...
+Larry Posted September 12, 2019 Author Share Posted September 12, 2019 Thanks, Roy. I might have. I'll look for it in my Utility ATR's. -Larry Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted September 12, 2019 Share Posted September 12, 2019 Not quite sure on which level you want to understand this. On a pure basic level, it is just a matter of opening "D:*.*" with AUX1=6 and read lines until an EOF. But this is probably not what you need. If you need to decode the raw (binary) version of a directory, then an entry consists of one byte of flags, two bytes of the size in sectors, two bytes of the start sector, 8 bytes for the file name, and 3 bytes for the extender. This makes 16 bytes per entry. For the precise layout, I need to check, but the MSB of the flags identify whether an entry in the directory is deleted or not (and if deleted, it is not shown and the entry can be recycled). If the flags is 0, then this ends the directory. Bit 5 is (if I recall correctly) the "I am write protected" flag, and bit 2 is always set to identify that the file is in Dos 2 layout (as compared to Dos 1 which has a different sector link). Then, some "invalid" combinations have been allocated by Dos 2.5 to indicate "I am outside of the 720 VTOC", and by Dos 2.++/Dos 2.XL to indicate "I am a headline". 1 Quote Link to comment Share on other sites More sharing options...
playermissile Posted September 12, 2019 Share Posted September 12, 2019 Inside Atari DOS has some good charts describing the binary format: https://www.atariarchives.org/iad/chapter2.php 2 Quote Link to comment Share on other sites More sharing options...
+Larry Posted September 12, 2019 Author Share Posted September 12, 2019 Thanks for the replies. Inside Atari Dos does have a nice diagram that shows the parts that I want. I'll look at Roy's program, and I just now remembered that David Small wrote a program for Creative Computing (in Atari Microsoft Basic) that I converted to TBXL and expanded to include, IIRC, the features I'm needing. Probably not for DD, though. Anyway, I'll dig it out, and take a look. Offhand, I don't remember its name, but I'll find it. Edit: Found it. It is "Disk Checker" by David Small in Creative Computing (and The Creative Atari which is posted at the Internet Archive). Also found my slightly enhanced TBXL version, DSKCHK3.TBS. Need to add a few features to make it do exactly what I'm looking for. When I get it tuned up a bit, I'll post it here. Quote Link to comment Share on other sites More sharing options...
Rybags Posted September 13, 2019 Share Posted September 13, 2019 Unsure about other Doses and I suspect they don't supply it, but normal CIO commands won't return stuff like start sector. In theory you could open every file then do a NOTE but that'd take a lot of time, plus some Doses base their NOTE/POINT values on relative file position rather than absolute sector. I've done a few programs that read the directory sectors and pull the info out, can put one up if you want. Quote Link to comment Share on other sites More sharing options...
+Larry Posted September 13, 2019 Author Share Posted September 13, 2019 Sure, I'd be glad to look at them, if you have them handy. Always happy to see code and learn (especially Basic)! Quote Link to comment Share on other sites More sharing options...
Rybags Posted September 13, 2019 Share Posted September 13, 2019 diskutil.zip That's my old disk utliity that allows low/enhanced density operations like dup disk, copy sectors and directory. You could pull the USR routine out and use that alone for your purposes. 1 Quote Link to comment Share on other sites More sharing options...
+Larry Posted September 13, 2019 Author Share Posted September 13, 2019 Thanks! I'll check it out! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.