home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 19780 < prev    next >
Encoding:
Text File  |  1992-12-23  |  2.2 KB  |  53 lines

  1. Path: sparky!uunet!news.claremont.edu!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Apending a file at the end of mail.
  5. Date: 23 Dec 1992 13:30:11 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Lines: 39
  8. Distribution: world
  9. Message-ID: <1h9pl3INN1c9@gap.caltech.edu>
  10. References: <21DEC199210505504@spades.aces.com> <1h6a0uINN9ks@gap.caltech.edu> <22DEC199209022524@spades.aces.com>,<1992Dec23.063743.3368@organpipe.uug.arizona.edu>
  11. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  12. NNTP-Posting-Host: sol1.gps.caltech.edu
  13.  
  14. In article <1992Dec23.063743.3368@organpipe.uug.arizona.edu>, vance@lpl.arizona.edu (Vance Haemmerle x4021) writes:
  15. >  Anyway, here's someone's question I couldn't answer after spending
  16. >  lots of time with the DOC CD-ROM.  Is there a system service or
  17. >  Run-Time Library routine that returns the amount of blocks allocated
  18. >  to a file?  Something like stat() in C, but the allocated space, not
  19. >  the used space.  I hope the answer doesn't involve reading the
  20. >  directory file format manulally or seting up RMS control structures.
  21.  
  22. Ah, Vance.  Are you trying to involve yourself in my and Ehud's rather amiable
  23. flamewar?  Of did you really not know about the F$FILE lexical, with the "ALQ"
  24. item (and the equivalent field in the FAB block).
  25.  
  26. From DCL you can:
  27.     $ WRITE SYS$OUTPUT F$FILE(file_name, "ALQ")
  28.  
  29. In a C program, you can (for LOGIN.COM in this case, but I'm sure you can
  30. figure out how to extend things):
  31. #
  32. include rms
  33.  
  34. main()
  35. {    struct FAB my_fab;
  36.  
  37.     my_fab = cc$rms_fab;
  38.     my_fab.fab$l_fna = "LOGIN.COM";
  39.     my_fab.fab$b_fns = strlen(my_fab.fab$l_fna);
  40.     SYS$OPEN(&my_fab);
  41.     SYS$CLOSE(&my_fab);
  42.     printf("%d\n", my_fab.fab$l_alq);
  43. }
  44.  
  45. --------------------------------------------------------------------------------
  46. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  47.  
  48. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  49. understanding of astronomy is purely at the amateur level (or below).  So
  50. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  51. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  52. hold me responsible for it, but my organization had nothing to do with it.
  53.