Detect the available drives on DOS (Developers)
Hi,
I face an interesting problem for a file selection dialog I want to create:
How do I detect which drive letters are actually available/used in DOS (using either DJGPP or a DOS/BIOS INT)?
I guess it is always safe to assume A, B and C are there?
What happens when no secondary disk drive is installed?
I found _dos_setdrive() in DJGPP and INT21 0Eh, but I'm not sure what happens when I _set_drive() with a non existing drive?
Also the return value is "the highest drive present", so that won't help me with gaps (e.g. A present, B isn't, C is, D-W are not and X is a mapped network drive).
Also, there is the 'undocumented' INT21 32h. Would that work for network-drives as well?
What would be the best practice to only find available drives (like e.g. DosZip file commander does)?
cheers
Ilu
---
Javascript on MS-DOS? Try DOjS https://github.com/SuperIlu/DOjS
Fediverse: @dec_hl@mastodon.social
Complete thread:
- Detect the available drives on DOS - SuperIlu, 07.07.2023, 21:14
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Detect the available drives on DOS - CandyMan, 07.07.2023, 21:41
- Detect the available drives on DOS - SuperIlu, 07.07.2023, 23:04
- Detect the available drives on DOS - Laaca, 08.07.2023, 10:36
- Detect the available drives on DOS - SuperIlu, 09.07.2023, 00:11
- Detect the available drives on DOS - Laaca, 08.07.2023, 10:36
- Detect the available drives on DOS - SuperIlu, 07.07.2023, 23:04
- Detect the available drives on DOS - ecm, 07.07.2023, 22:02
- Detect the available drives on DOS - Rugxulo, 08.07.2023, 07:56
- Detect the available drives on DOS - marcov, 09.07.2023, 23:18
- Detect the available drives on DOS - SuperIlu, 10.07.2023, 18:15
- Detect the available drives on DOS - CandyMan, 07.07.2023, 21:41
Mix view