home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPTOOL1.ZIP / EXISTS.INC < prev   
Encoding:
Text File  |  1987-03-28  |  335 b   |  25 lines

  1.  
  2. #log File exists predicate
  3.  
  4. (*
  5.  * exists - return true if a file exists
  6.  *
  7.  *)
  8.  
  9. function exists(name: anystring): boolean;
  10. var
  11.    fd: file;
  12. begin
  13.    assign(fd,name);
  14.    {$i-} reset(fd); {$i+}
  15.    if ioresult = 0 then
  16.    begin
  17.       close(fd);
  18.       exists := true;
  19.    end
  20.    else
  21.       exists := false;
  22. end;
  23.  
  24.  
  25.