home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 13054 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  2.0 KB

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