Are there directory devices with a name longer than 3 letters
Are there directory devices with a name longer than 3 letters
As the Subject aks: Are their any directory devices which have a name with more than 3 characters (without the trailing digit and underscore) or can a device be defined (with e.g. FLP_USE) with a longer name than 3 characters. Example is a name like "HDSK" possible?
I want to write a SuperBASIC function, which strips the Directory Device Name from a filename, and it would be much easier, if I can rely, that no directory device has a name which is longer than 3.
I want to write a SuperBASIC function, which strips the Directory Device Name from a filename, and it would be much easier, if I can rely, that no directory device has a name which is longer than 3.
http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX

Re: Are there directory devices with a name longer than 3 letters
Directory devices in QDOS can have up to four characters in length (then, obviously, you cannot use a unit number anymore).
The most prominent that actually uses all four characters (and the only ony I know) is "BOOT", which is booted from even before "mdv", thus used for boot overrides for new directory devices temporarily during the boot process. But this is typically re-named during startup to, for example, "win" or "flp" - So, not encountered on a running machine, typically.
You can argue whether BOOT is a directory device - it supplies a stream only. OTOH, it's used for booting, so it must be one
If you look into the definition tables, a directory device driver name has a word length - so, in theory, it could be much longer in QDOS.
SMSQ/E has only four characters reserved for that string.
For programs like yours, I'd recommend walking the list of directory device drivers (base address in system variables) and checking the string at $3c in each linkage block - this way, you can build a list of valid directory drivers for this specific machine.
The QL network complicates things even more: Note "NET2_win1_" is a valid directory device!
The most prominent that actually uses all four characters (and the only ony I know) is "BOOT", which is booted from even before "mdv", thus used for boot overrides for new directory devices temporarily during the boot process. But this is typically re-named during startup to, for example, "win" or "flp" - So, not encountered on a running machine, typically.
You can argue whether BOOT is a directory device - it supplies a stream only. OTOH, it's used for booting, so it must be one

If you look into the definition tables, a directory device driver name has a word length - so, in theory, it could be much longer in QDOS.
SMSQ/E has only four characters reserved for that string.
For programs like yours, I'd recommend walking the list of directory device drivers (base address in system variables) and checking the string at $3c in each linkage block - this way, you can build a list of valid directory drivers for this specific machine.
The QL network complicates things even more: Note "NET2_win1_" is a valid directory device!
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Re: Are there directory devices with a name longer than 3 letters
The known devices are seen at SV_DDLST.ql_freak wrote:As the Subject aks: Are their any directory devices which have a name with more than 3 characters (without the trailing digit and underscore) or can a device be defined (with e.g. FLP_USE) with a longer name than 3 characters. Example is a name like "HDSK" possible?
7000 4E75
- NormanDunbar
- Forum Moderator
- Posts: 2470
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Are there directory devices with a name longer than 3 letters
This might help, it's from DJToolkit:
https://superbasic-manual.readthedocs.i ... l#dev-name
Or this:
https://superbasic-manual.readthedocs.i ... l#max-devs
Cheers,
Norm.
https://superbasic-manual.readthedocs.i ... l#dev-name
Or this:
https://superbasic-manual.readthedocs.i ... l#max-devs
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Are there directory devices with a name longer than 3 letters
I have tried this (afaik). But (at least on QPC2) there has been a problem. I didn't get all DDs, or there was a gap - can't remember.tofro wrote:For programs like yours, I'd recommend walking the list of directory device drivers (base address in system variables) and checking the string at $3c in each linkage block - this way, you can build a list of valid directory drivers for this specific machine.
The problem are those dreaded (SuperBASIC) default directories. I think I have to write a new SuperBASIC extension "fopen" function or so, which ignores the default directories. All File I/O functions/procedures are unfortunately handled by the default directories of SB :-(
I know :-(tofro wrote:The QL network complicates things even more: Note "NET2_win1_" is a valid directory device!
http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX

- mk79
- QL Wafer Drive
- Posts: 1349
- Joined: Sun Feb 02, 2014 10:54 am
- Location: Esslingen/Germany
- Contact:
Re: Are there directory devices with a name longer than 3 letters
At least in SMSQ/E directory drivers always must have a drive number in the range 1..8. So in theory you can have 4 chars + number, but I've never seen it in practice and all hell might break loose if you trytofro wrote:Directory devices in QDOS can have up to four characters in length (then, obviously, you cannot use a unit number anymore).

Due to the missing number (and filename!) it must be a stream deviceYou can argue whether BOOT is a directory device - it supplies a stream only. OTOH, it's used for booting, so it must be one


True, those are a pain to handle.The QL network complicates things even more: Note "NET2_win1_" is a valid directory device!
- NormanDunbar
- Forum Moderator
- Posts: 2470
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Are there directory devices with a name longer than 3 letters
Hi Peter,
The result was:
For some unknown reason - unknown to me anyway - there always seems to be a directory driver with a null name. The list created is all the directory drivers enabled on my QPC2 system - I'm puzzled as to why you think there might be something missing or a gap?
Try the above with DJToolkit loaded, see what you get.
Cheers,
Norm.
I started QPC2 this morning and:ql_freak wrote:I have tried this (afaik). But (at least on QPC2) there has been a problem. I didn't get all DDs, or there was a gap - can't remember.
Code: Select all
dev_use 1, win1_c68_
1000 addr = 0
1010 REPeat loop
1020 PRINT "<" & DEV_NAME(addr) & ">"
1030 IF addr = 0 THEN EXIT loop: END IF
1040 END REPeat loop
Code: Select all
<DOS>
<DEV>
<FLP>
<WIN>
<RAM>
<>
Try the above with DJToolkit loaded, see what you get.
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Are there directory devices with a name longer than 3 letters
All versions of the QubIDE driver seem to do this.mk79 wrote:Due to the missing number (and filename!) it must be a stream deviceBut do you actually know anybody implementing the BOOT device? All auto-boot implementations I know temporarily rename their device to MDV for auto-booting. Makes things interesting when two devices do this
I considered implementing a BOOT device for QL-SD, but due to space considerations I staid with the simple MDV thing for now.
They implement a device named "BOOT" which is higher in the boot hierarchy than any other driver. That enables QubIDE to co-exist (and move itself in front of them) whith floppy device drivers that go the mdv way, and still revert all the changes it did to the names.
The "open" code of QubIDE's BOOT device will then walk the list of device drivers and count the number of "mdv" occurences - If there's more than one, it detects "there must already be a floppy device driver that has renamed itself to mdv" - In this case, it will chain in and rename itself "mdv" to be the boot device - It needs to detect this in order to find out what needs to be reverted after boot from "mdv".
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
- mk79
- QL Wafer Drive
- Posts: 1349
- Joined: Sun Feb 02, 2014 10:54 am
- Location: Esslingen/Germany
- Contact:
Re: Are there directory devices with a name longer than 3 letters
Bug or definition problem in DEV_NAME. It doesn't return the next block in addr, but the current one. So on RAM it returns with the addr of RAM, you call it again, then it tries to go to the next block, only then realising that it's finished and returning an empty device string afterwards.NormanDunbar wrote:For some unknown reason - unknown to me anyway - there always seems to be a directory driver with a null name.
Marcel
Last edited by mk79 on Tue Jul 28, 2020 1:56 pm, edited 1 time in total.
Re: Are there directory devices with a name longer than 3 letters
I have torn a lot of hair out due to similar problems over the years. Some of my solutions in S*BASIC can be found at my Knoware site. See for example GO TO/Files.ql_freak wrote:I have tried this (afaik). But (at least on QPC2) there has been a problem. I didn't get all DDs, or there was a gap - can't remember.tofro wrote:For programs like yours, I'd recommend walking the list of directory device drivers (base address in system variables) and checking the string at $3c in each linkage block - this way, you can build a list of valid directory drivers for this specific machine.
The problem are those dreaded (SuperBASIC) default directories. I think I have to write a new SuperBASIC extension "fopen" function or so, which ignores the default directories. All File I/O functions/procedures are unfortunately handled by the default directories of SB
I knowtofro wrote:The QL network complicates things even more: Note "NET2_win1_" is a valid directory device!
PS None of these solutions are geared towards network drivers tho', as at the time I was most active QL networking was more a matter of fluke than of logic.
Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen