home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / pascal / 5221 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.6 KB  |  48 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!uvaarpa!murdoch!Turing.ORG!bk
  3. From: bk@Turing.ORG (Brian Knatz)
  4. Subject: bk asks: File Handle in TP
  5. Message-ID: <1992Sep7.021438.9222@murdoch.acc.Virginia.EDU>
  6. Summary: I need a file handle in Turbo Pascal
  7. Keywords: interrupts, file handle, FileRec.handle
  8. Sender: Brian Knatz
  9. Organization: The Turing Project, Charlottesville Virginia.
  10. Date: Mon, 7 Sep 1992 02:14:38 GMT
  11. Lines: 35
  12.  
  13. Described on page 348 of the Turbo Pascal 4.0 manual:
  14.  
  15. File types are represented as records. Typed files and untyped
  16. files occupy 128 bytes, which are laid out as follows:
  17.  
  18. type
  19.   FileRec = record
  20.                 Handle    :    word;
  21.                 Mode    :    word;
  22.                 RecSize    :    word;
  23.                 Private    :    array[1..26] of byte;
  24.                 UserData:    array[1..16] of byte;
  25.                 Name    :    array[1..79] of char;
  26.             end;{FileRec}
  27.  
  28. Question: 
  29.     If I have a FILE, f, and a FileRec, fr, how do I get them to
  30. refer to the same file?
  31.     How, given an assigned-and-reset f do I take a look at the its Handle?
  32.  
  33. I'd like to explore some of DOS's file-related interrupts
  34. (like interrupt 21,57), but they all want aspects of the
  35. FileRec I don't know how to access.
  36.  
  37. Thanks in advance for any help.
  38.  
  39. bk
  40. -- 
  41.  
  42. ------------------------------------------------------------------------
  43. Brian Knatz, User Services Programmer    "Language is a Virus"
  44. Academic Computing Center                  - William S. Burroughs
  45. University of Virginia                     - Laurie Anderson
  46. bk@Turing.ORG                            "The Truth is a Virus" - H.H.H.
  47. ------------------------------------------------------------------------
  48.