home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:13054 comp.os.msdos.programmer:8925
- Path: sparky!uunet!decwrl!access.usask.ca!ccu.umanitoba.ca!ciit85.ciit.nrc.ca!brandonu.ca!dueck
- Newsgroups: comp.lang.c,comp.os.msdos.programmer
- Subject: Re: file positioning with buffered/unbuffered I/O
- Message-ID: <1992Aug31.150850.2188@brandonu.ca>
- From: dueck@brandonu.ca
- Date: 31 Aug 92 15:08:50 CST
- References: <1992Aug8.111834.19417@klaava.Helsinki.FI> <1992Aug10.205740.4357@irscscm.UUCP> <1992Aug25.153322.13793@jhunix.hcf.jhu.edu>
- Organization: Brandon University, Brandon, Manitoba, Canada
- Lines: 26
-
- In article <1992Aug25.153322.13793@jhunix.hcf.jhu.edu>, gregg_c@jhunix.hcf.jhu.edu (Christopher H Gregg) writes:
- > Hi, I am writing an assembly language program and I am having some
- > problems with it. The program is memory resident and it traps int 1Ch.
- > After it traps the interrupt, it checks if a certain amount of time
- > has passed and then it deletes a certain file on a directory. The
- > problem is that when I try to use either DOS function 13h (delete file)
- > or DOS function 41h (which I would prefer), the program crashes.
- >
- You have become stuck on one of the worst problems in DOS: its not
- re-entrant. However, you can tell when its safe to call DOS by checking
- the DOS-safe flag. This is a one-byte value located one byte past the
- address returned in DS:SI by interrupt 21 function 5D06 and it is zero
- when it is safe to call DOS. Unfortunately the flag lies: It is safe to call
- DOS if DOS is busy with a call <= 0x0C, mostly standard input and output
- calls. However, when DOS is in a keyboard-polling loop, it invokes
- interrupt 28, the DOS-idle interrupt.
-
- Your program should acquire its data via int 1C and write it out from a
- routine called via int 28.
-
- This solution will break if you have hot-keyed back into a TSR, thereby
- activating via int 28. The TSR can't use int 21 subfunction <= 0C, and
- int 28 can't be re-entered. Does anyone know the solution to this problem?
-
- Gery Dueck
- dueck@brandonu.ca
-