Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Good way to check if file already opened? (GW-BASIC porting) (Developers)

posted by tkchia Homepage, 02.02.2021, 14:35

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:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 127 users online (0 registered, 127 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum