bugbiter Posted May 8, 2016 Share Posted May 8, 2016 Hello all, I'm sorry if this has been explaied before but I am unable to find this in the SDX manuals or in the forum. I have an application where I list a directory and call files. Working fine in SpartaDos. But how can I imply moving into sparta Dos subdirectories? My application was written based on Dos2.5 first. I open the directory, read in all enties and save the 8 characters of each filename into a list for later call. Turned out it works fine with SDX as well. But how do I even recognize SDX subdirectory entires? They do not show at all with my method. Right now I have to go back to Dos, type CD <subdirectory> and restart my application to acces those subdirectories. I would like to imply Dir changes in my code. Seems I need a method to get a list of available subdirectory names and some code to navigate between directories. Can anyone help me here? Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted May 8, 2016 Share Posted May 8, 2016 (edited) 6.3.13 Change Current Directory (CHDIR) Purpose Change the current working directory of a disk. Syntax XIO 44,#IOCB,0,0,"Dd:path" Remarks This will change the directory that is used when the specified drive is accessed without reference to a specific directory. The rules regarding path and IOCB status defined in XIO 42 apply here XIO 44,#3,0,0,"DX:SUBDIR1" XIO 44,#3,0,0,"DX:<SUBDIR2" or something similar. check the sdx manual again and search for XIO Edited May 8, 2016 by rdea6 Quote Link to comment Share on other sites More sharing options...
bugbiter Posted May 8, 2016 Author Share Posted May 8, 2016 Thanks for the quick response! I have already taken a look into the programmer's manual. But I don't understand how I use or 'translate' the XIO commands in Assembler. Quote Link to comment Share on other sites More sharing options...
drac030 Posted May 8, 2016 Share Posted May 8, 2016 The programming guide deals with the SDX-specific (not backwards compatible) special API based on symbols. To use XIO calls you have to stick to the traditional CIO API. An example of a XIO call in assembler is here: http://atariki.krap.pl/index.php/CHANGE_DIRECTORY Quote Link to comment Share on other sites More sharing options...
bugbiter Posted May 8, 2016 Author Share Posted May 8, 2016 Great! Thank you! Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 8, 2016 Share Posted May 8, 2016 XIO is a standard CIO call e.g. XIO <cmd>,#<iocb>,<aux1>,<aux2>,<fspec> Usually "Special" command is assumed when using this in Basic. The difference between special commands and the normal range of GET/PUT types is that the IOCB doesn't need to be already opened for the special commands to work. From assembly POV: Store byte <cmd> into ICCOM <iocb> as usual passed in X register (multiplied by 16) <aux1/2> auxilliary byte #1 and #2 values into ICAX1/2 <fspec> device/file specification, as per procedure if issuing an OPEN command. Filespec is only needed if the IOCB isn't already opened to the required device. 1 Quote Link to comment Share on other sites More sharing options...
bugbiter Posted May 8, 2016 Author Share Posted May 8, 2016 (edited) Thanks guys for your hints so far! OK, so I open a directory with command icax1=6 and icax2=0 (SDX short format) and filespec *.* and read in all the Dir entries and store them in memory. Some of them are files, some of them are directory names. How can I tell which are the directories so that I can mark them accordingly in my listup and to correctly apply a directory change instead of loading the file when called? I guess there's a marker bit somewhere in the entry but I cant find it in the Sparta Dos description at first glance.. (I've got a headcold right now and can't concentrate well so I just can't be bothered.. ) It will take me a bit of trying and analysing to figure it out but if you guys can tell me in one brief sentence I would greatly appreciate :-) Edited May 8, 2016 by bugbiter Quote Link to comment Share on other sites More sharing options...
bugbiter Posted May 8, 2016 Author Share Posted May 8, 2016 (edited) Doh! I found it in Chapter 7 - it's bit 5 of byte 0 The cold seems to be getting better! Edited May 8, 2016 by bugbiter Quote Link to comment Share on other sites More sharing options...
drac030 Posted May 8, 2016 Share Posted May 8, 2016 I do not know which SDX version you are on, but in recent ones (4.4x), when you open the directory for the short listing (OPEN #1,6,0,"D:*.*"), the directory names will have the ":" in front of them: 1 Quote Link to comment Share on other sites More sharing options...
bugbiter Posted May 10, 2016 Author Share Posted May 10, 2016 Thanks guys! My BGP Picture viewer can now recognize subdirectory names in the Directory list and marks them up with brackets. No to the actual change of the working path: XIO 44,#IOCB,0,0,"Dd:path" - Does that mean that I always have to keep track and spell out the whole path? Or may I just put in the subdirectory name? And how can I do a 'CD ..' in assembler to get one level up? Do I need to delete the last name in the path string and put it in the xio 44 call? Is there an easier way? Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted May 10, 2016 Share Posted May 10, 2016 The path is relative to the current working directory unless it begins with a ">" or "\" immediately following the device ID (i.e. after "Dn:"). So if the current working directory is "TEST", you may CWD to a directory inside of "TEST" by omitting the leading path delimiter. To back up one level, "XIO 44,#IOCB,0,0,"Dn:<") will do (you may use "..\" instead if you wish). 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.