home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!waikato.ac.nz!comp.vuw.ac.nz!zl2tnm!toyunix!don
- Newsgroups: comp.os.vms
- Subject: Re: Apending a file at the end of mail.
- Message-ID: <16209357@zl2tnm.gen.nz>
- From: don@zl2tnm.gen.nz (Don Stokes)
- Date: 23 Dec 92 10:28:22 GMT
- Sender: news@zl2tnm.gen.nz (GNEWS Version 2.0 news poster.)
- References: <1992Dec23.063743.3368@organpipe.uug.arizona.edu>
- Distribution: world,local
- Organization: The Wolery
- Lines: 46
-
- vance@lpl.arizona.edu (Vance Haemmerle x4021) writes:
- > And to think... TPU becomes the default editor under VMS V6.0.
- > Oh the horror! ;-)
-
- Not on my system. (He says, despairing of finding enough space to put
- 5.4 up on....)
-
- > Anyway, here's someone's question I couldn't answer after spending
- > lots of time with the DOC CD-ROM. Is there a system service or
- > Run-Time Library routine that returns the amount of blocks allocated
- > to a file? Something like stat() in C, but the allocated space, not
- > the used space. I hope the answer doesn't involve reading the
- > directory file format manulally or seting up RMS control structures.
-
- What's so hard about RMS control structures?
-
- .title get_hbk Get highest block allocated to file
- ;
- ; allocated size = GET_HBK( filename string passed by descriptor )
- ;
- .psect HBK_RW, long,noexe,noshr,wrt
- fab: $FAB xab=xabfhc
- xabfhc: $XABFHC
-
- .psect HBK_RE, exe,shr,nowrt
- .entry GET_HBK, ^M<>
- movl 4(AP), R0 ; Find arg string
- cvtwb (R0), fab+FAB$B_FNS ; Poke size & address into FAB
- movaq @4(R0), fab+FAB$L_FNA
- $OPEN fab ; Open file
- blbc R0, 99$ ; OK?
- $CLOSE fab ; Close it again
- movl xabfhc+XAB$L_HBK, R0 ; Grab highest block
- ret
-
- 99$: $EXIT_S R0
-
- .end
-
- (Yes, FAB$L_ALQ contains the same info, but I wanted to demonstrate just
- how easy XABs are.)
-
- --
- Don Stokes, ZL2TNM (DS555) don@zl2tnm.gen.nz (home)
- Network Manager, Computing Services Centre don@vuw.ac.nz (work)
- Victoria University of Wellington, New Zealand +64-4-495-5052
-