Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: fairfield@slacvx.slac.stanford.edu
Subject: Re: File sizes using Pascal on VMS...
Date: Fri, 18 Jun 1993 08:10:55 GMT	[thread overview]
Message-ID: <1993Jun18.001055.1@slacvx.slac.stanford.edu> (raw)
In-Reply-To: 1993Jun17.095412.20335@icf.hrb.com

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...


      reply	other threads:[~1993-06-18  8:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-17 14:54 File sizes using Pascal on VMS Douglas B. Dodson
1993-06-18  8:10 ` fairfield [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox