Re: [Ql-Users] SBASIC 'ls' procedure
>> To save you reinventing the wheel Jan, Norman Dunbar's DJToolkit has an > extension called LEVEL2 which tests for a Level 2 filing system. The > assembler source djtoolkit_asm is included with the toolkit - just search > for 'level2' in that source. > > http://www.dilwyn.me.uk/tk/djtk.zip > Hmm, I should have explained a bit more rather than leaving you to do it. Just call trap #3 D0=$4F IOF.XINF after reserving a 64 byte block (call with d1=0, d2.b=0, d3.w=timeout, a0=channel ID, a1=pointer to the 64 byte buffer.). If no info block is returned (check d0 on return), there is no level 2. I'm aware of that, but just want to avoid having to load SB extensions. Oh well, I'm already CALLing SD.CHENQ code from SB so it shouldn't be much hassle to implement. ___ QL-Users Mailing List
Re: [Ql-Users] SBASIC 'ls' procedure
- NOTE: On non-V2 drivers which don't support subdirectories, ls will fail because the FNAME$ function stops with 'bad parameter' on directory channels. This can be avoided by adjusting line 1710 in the code (as indicated in the REMarks). I'll probably have to design another machine code call to find out whether a device is V2 or not :( To save you reinventing the wheel Jan, Norman Dunbar's DJToolkit has an extension called LEVEL2 which tests for a Level 2 filing system. The assembler source djtoolkit_asm is included with the toolkit - just search for 'level2' in that source. http://www.dilwyn.me.uk/tk/djtk.zip Hmm, I should have explained a bit more rather than leaving you to do it. Just call trap #3 D0=$4F IOF.XINF after reserving a 64 byte block (call with d1=0, d2.b=0, d3.w=timeout, a0=channel ID, a1=pointer to the 64 byte buffer.). If no info block is returned (check d0 on return), there is no level 2. Dilwyn ___ QL-Users Mailing List
Re: [Ql-Users] SBASIC 'ls' procedure
On 2017-02-12 16:43, Jan Bredenbeek wrote: On 12 February 2017 at 15:29, RWAP Softwarewrote: Hi Jan, That is great - it is a nice function which can be useful. Could I ask you to consider moving (or Forking?) the repository to the new SInclair QL Github, as this is intended to keep all of the QL stuff together - Done that - the directory structure is a bit strange now but I'll correct that asap. Thanks Jan - I have also found a few more Github repositories and forked them across :) Rich Mellor RWAP Software www.rwapsoftware.co.uk www.sellmyretro.com ___ QL-Users Mailing List
Re: [Ql-Users] SBASIC 'ls' procedure
On 12 February 2017 at 15:29, RWAP Softwarewrote: > Hi Jan, > > That is great - it is a nice function which can be useful. > > Could I ask you to consider moving (or Forking?) the repository to the new > SInclair QL Github, as this is intended to keep all of the QL stuff > together - > Done that - the directory structure is a bit strange now but I'll correct that asap. -- *Jan Bredenbeek* | Hilversum, NL | j...@bredenbeek.net ___ QL-Users Mailing List
Re: [Ql-Users] SBASIC 'ls' procedure
Hi Jan, That is great - it is a nice function which can be useful. Could I ask you to consider moving (or Forking?) the repository to the new SInclair QL Github, as this is intended to keep all of the QL stuff together - https://github.com/SinclairQL Rich On 2017-02-12 14:24, Jan Bredenbeek wrote: I've updated the code with various improvements and fixes: - Listing now adjusts to window size and can be aborted by pressing 'Q' or ESC, even when recursing directories; - Redirection by DEV device is now handled correctly (so long as you don't rename the DEV device itself ;)) - SMSQ is no longer required; it will now also work on native QL with TK2 and Minerva fitted. - NOTE: On non-V2 drivers which don't support subdirectories, ls will fail because the FNAME$ function stops with 'bad parameter' on directory channels. This can be avoided by adjusting line 1710 in the code (as indicated in the REMarks). I'll probably have to design another machine code call to find out whether a device is V2 or not :( https://github.com/janbredenbeek/QL/blob/master/SBASIC/ls_bas Jan. On 3 February 2017 at 11:31, Jan Bredenbeekwrote: Hi Wolfgang, On 3 February 2017 at 05:01, Wolf wrote: Are you aware of the SUB device by Phil Borman? It does the same thing, and there is no copright problem since it's on Dilwyn's page ( http://www.dilwyn.me.uk/tk/index.html) Thanks, I can vaguely remember it (it might as well be in my BBS archive). Pity it has no source code but indeed a nice thing to learn using DISA. As for the copyright issue, I only do it out of curiosity but it might be useful inspiration to improve the DEV device ;). regards, -- *Jan Bredenbeek* | Hilversum, NL | j...@bredenbeek.net Rich Mellor RWAP Software www.rwapsoftware.co.uk www.sellmyretro.com ___ QL-Users Mailing List
Re: [Ql-Users] SBASIC 'ls' procedure
I've updated the code with various improvements and fixes: - Listing now adjusts to window size and can be aborted by pressing 'Q' or ESC, even when recursing directories; - Redirection by DEV device is now handled correctly (so long as you don't rename the DEV device itself ;)) - SMSQ is no longer required; it will now also work on native QL with TK2 and Minerva fitted. - NOTE: On non-V2 drivers which don't support subdirectories, ls will fail because the FNAME$ function stops with 'bad parameter' on directory channels. This can be avoided by adjusting line 1710 in the code (as indicated in the REMarks). I'll probably have to design another machine code call to find out whether a device is V2 or not :( https://github.com/janbredenbeek/QL/blob/master/SBASIC/ls_bas Jan. On 3 February 2017 at 11:31, Jan Bredenbeekwrote: > Hi Wolfgang, > > On 3 February 2017 at 05:01, Wolf wrote: > > Are you aware of the SUB device by Phil Borman? It does the same thing, >> and there is no copright problem since it's on Dilwyn's page ( >> http://www.dilwyn.me.uk/tk/index.html) >> > > Thanks, I can vaguely remember it (it might as well be in my BBS archive). > Pity it has no source code but indeed a nice thing to learn using DISA. As > for the copyright issue, I only do it out of curiosity but it might be > useful inspiration to improve the DEV device ;). > > regards, > > -- > *Jan Bredenbeek* | Hilversum, NL | j...@bredenbeek.net > -- *Jan Bredenbeek* | Hilversum, NL | j...@bredenbeek.net ___ QL-Users Mailing List
[Ql-Users] SBASIC 'ls' procedure
Okay, here it is. Merge this into your BOOT file and you'll have a Unix-like 'ls' command, and even a 'lsr' command to list directories recursively. It lists one file per line, with type, size and date info, and without the subdirectory names in front of each filename (unlike DIR and WSTAT). The current version requires SMSQ because it uses LGET and DMEDIUM_DRIVE. It can be made to work on native QLs without these commands but I couldn't work out a way to separate the device+dir and file wildcard without it. On JS and earlier it will probably crash the machine because it has more than 10 LOCal variables... Here is the link: https://github.com/janbredenbeek/QL/blob/master/SBASIC/ls_bas Have fun, -- *Jan Bredenbeek* | Hilversum, NL | j...@bredenbeek.net ___ QL-Users Mailing List