/*  --- University of Sussex POPLOG file -----------------------------------
 *  File:           $usepop/pop/local/plog/lib/exists.pl
 *  Purpose:        Does a file exist?
 *  Author:         Unknown, ???
 *  Machines:       all
 *  Documentation:  HELP * EXISTS
 *  Related Files:
 */

exists(File) :-
   atom(File),
   F is valof(false),
   Str is consstring(explode(quote(File)),datalength(quote(File))),
   Stat is sysopen(quote(Str),0,quote(F)),
   Stat \= F.
