From:	CSBVAX::MRGATE!info-vax-RELAY@KL.sri.com@SMTP  1-AUG-1988 17:36
To:	ARISIA::EVERHART
Subj:	Re: file size


Received: from nrl.arpa (NRL3.ARPA) by KL.sri.com with TCP; Wed, 27 Jul 88 10:41:17 PDT
Date: 26 Jul 88 18:29:00 EDT
From: "NRL::HERMAN" <herman%nrl.decnet@nrl.arpa>
Subject: Re: file size
To: "info-vax" <info-vax@kl.sri.com>

	I wish to thank everyone (Roger Terrell, Carl J. Lydick, Bill Sherman,
Les LaCroix, Carlo Mekenkamp) who responded to my question on how to
determine the size of a file from within a program.  Since I am using FORTRAN,
I am using the routine sent me by John H. Yates which follows.


>Below is a brute force method I put together a few years ago.
>If you find a more elegant way please send me how. John
>*************************************************
>John H. Yates , Ph.D.
>Director of the Chemistry Computer Facility
>Department of Chemistry
>University of Pennsylvania
>Philadelphia, PA 19104
>yates%a.chem@upenn.edu (INTERNET)
>(215)898-4714
>*************************************************
>      Subroutine Get_F_Size(File,IAlloc)
>C This program returns the size of a file (in blocks allocated),
>C via a Fortran UserOpen procedure.
>C
>C  John H. Yates
>C  Department of Chemistry
>C  University of Pennsylvania
>C  March 1986
>C
>C  Version 01-001
>C
>      Integer FAlloc,Get_File_Size
>      Common/FilAlloc/FAlloc
>      Character*(*) File
>      External Get_File_Size
>      Open(Unit=31,File=File,Status='OLD',ReadOnly,
>     *   UserOpen=Get_File_Size)
>      Close(Unit=31)
>      IAlloc = FAlloc
>      Return
>      End
>      Integer Function Get_File_Size(FAB,RAB,LUN)
>      Include '($SYSSRVNAM)'
>      Include '($FABDEF)'
>      Include '($RABDEF)'
>      Record /FABDEF/FAB, /RABDEF/RAB
>      Integer*4 LUN,Status
>      Integer FAlloc
>      Common/FilAlloc/FAlloc
>      Status = sys$open(FAB)
>      If (Status) Status = Sys$connect(RAB)
>      Get_File_Size = Status
>      FAlloc = FAB.FAB$L_ALQ
>      Return
>      End


						Charles Herman
						herman%nrl.decnet@nrl.arpa

