Good way to check if file already opened? (GW-BASIC porting) (Developers)
Hi all,
I am trying to port the CHKFOP routine in Microsoft's GW-BASIC sources, to work with MS-DOS 2+ file descriptors rather than DOS 1.x FCBs.
The routine is supposed to check whether a named file is currently open, so that e.g. the KILL and NAME commands can prevent one from deleting or renaming an open file.
Any ideas on how I might do this?
The 1983 implementation basically looks through GW-BASIC's own table of open files, and compares drive letters, file names, and file extensions. I suppose this is enough under DOS 1.x, but it is not quite enough under DOS 2+ which may have subdirectories, network paths, etc.
Thanks!
---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"
Complete thread:
- Good way to check if file already opened? (GW-BASIC porting) - tkchia, 02.02.2021, 14:35 (Developers)
- Good way to check if file already opened? (GW-BASIC porting) - Ringding, 02.02.2021, 20:57
- Good way to check if file already opened? (GW-BASIC porting) - tkchia, 04.02.2021, 09:05
- Good way to check if file already opened? (GW-BASIC porting) - rr, 02.02.2021, 21:16
- Good way to check if file already opened? (GW-BASIC porting) - Laaca, 02.02.2021, 22:18
- Good way to check if file already opened? (GW-BASIC porting) - tkchia, 13.02.2021, 19:23
- Good way to check if file already opened? (GW-BASIC porting) - Ringding, 02.02.2021, 20:57