From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,80b9cab992bfa976 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-06-18 00:16:28 PST Newsgroups: comp.sys.dec Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!ux1.cso.uiuc.edu!uwm.edu!linac!unixhub!slacvx.slac.stanford.edu!fairfield From: fairfield@slacvx.slac.stanford.edu Subject: Re: File sizes using Pascal on VMS... Message-ID: <1993Jun18.001055.1@slacvx.slac.stanford.edu> Sender: news@unixhub.SLAC.Stanford.EDU Organization: Stanford Linear Accelerator Center References: <1993Jun17.095412.20335@icf.hrb.com> Date: Fri, 18 Jun 1993 08:10:55 GMT In article <1993Jun17.095412.20335@icf.hrb.com>, dbd@icf.hrb.com (Douglas B. Dodson) writes: > Hello all, > > We have two situations which have presented us with a small problem. This > problem deals with using Pascal on a DEC VAX 4000 series running the latest > version of VMS. First the situations: > > 1) A file exists on the disk and we wish to obtain the file size (both actual > and allocated). We would like to do this without spawning off a command file > and parsing the output. We have looked for a system call or library routine > but can't seem to find any to fit the bill. The file on the disk is closed and > the priveleges should not be a factor. Sounds like a simple problem, yet we > can't find an "easy" way to do it. The "easy" way is to use SYS$OPEN and SYS$CLOSE with a properly constructed FAB. :-) The total space taken on disk (allocated) is at FAB$L_ALQ, while what you call the "actual" size is the EBK (End of file BlocK) which is gotten by chaining an XAB defined by $XABFHCDEF to the FAB. BTW, the documentation on these things is (I believe) in the I/O Users Reference Manual rather than in any of the RTL's or SS references. OK, it's simple if you've done it once before :-} I've got an example program written in Fortran which is too long to post, but which I'll be happy to send to anyone whose interested. It also retrieves all four of a file's date fields. -Ken -- Dr. Kenneth H. Fairfield | Internet: Fairfield@Slac.Stanford.Edu SLAC, P.O.Box 4349, MS 98 | DECnet: 45537::FAIRFIELD (45537=SLACVX) Stanford, CA 94309 | FAX: (415) 926-4335 ---------------------------------------------------------------------------- These opinions are mine, not SLAC's, Stanford's, nor the DOE's...