Task

Verify that a file called     input.txt     and   a directory called     docs     exist.



This should be done twice:  

   once for the current working directory,   and
   once for a file and a directory in the filesystem root.


Optional criteria (May 2015):   verify it works with:

   zero-length files
   an unusual filename:     `Abdu'l-Bahá.txt  


U0 FileExists(U8 *f) {
  if (FileFind(f) && !IsDir(f)) {
    Print("'%s' file exists.\n", f);
  } else {
    Print("'%s' file does not exist.\n", f);
  }
}
 
U0 DirExists(U8 *d) {
  if (IsDir(d)) {
    Print("'%s' directory exists.\n", d);
  } else {
    Print("'%s' directory does not exist.\n", d);
  }
}
 
FileExists("input.txt");
FileExists("::/input.txt");
DirExists("docs");
DirExists("::/docs");