home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TOOL_INC.ZIP / FILESIZE.INC < prev    next >
Encoding:
Text File  |  1988-01-29  |  407 b   |  22 lines

  1.  
  2. (*
  3.  * filesize.inc - utility library to return the size of a file in bytes.
  4.  *                returns 0 if the file does not exist
  5.  *
  6.  * shs 14-feb-86, (rev. 21-Dec-87)
  7.  *
  8.  *)
  9.  
  10. function file_size(name: anystring): real;
  11. var
  12.    DirInfo:     SearchRec;
  13.  
  14. begin
  15.    FindFirst(name,$21,DirInfo);
  16.    if (DosError <> 0) then
  17.       file_size := 0
  18.    else
  19.       file_size := DirInfo.size;
  20. end;
  21.  
  22.