[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Probe-file and errors



What seems to be impossible, for some reason, is to make simple things simple.
Here is the original application I had in mind:
- I need to find a dictionary file that is the key to everything else.
  Access is to a remote machine of unspecified nature.
- Depending on the remote file system, the dictionary file may be under
  different paths (e.g. /usr/xxx for a Unix machine, and so on).
- There are only two or three possible remote paths, one per machine, maybe.
- My code just wants to do
  (cond ((probe-file "/usr/foo/bar")
         ...)
        ((probe-file "/user/may/be")
         ...)
        ((probe-file "/yet/another/one")
         ...)
        (t
	 ... cannot find it. Bye. ...))
  Simple as that.

I do not (DO NOT!) want to handle an error. This is the simplest possible
thing I can ask of a file system. Do you have it or not? I couldn't care
less that the pathname is malformed because Unix directories must sit under
/usr/. I just want to see whether the file is there.

I understand there may be serious cases when one wants to "stop dead in the
tracks". I am willing to believe one really cares to find out why the file
system thinks there is no such file because the color of the third bit in
the filename is not blue. But I do want to have a simple call. I have seen
many systems that use exception handling as a way of passing arguments,
and they are NOT the clearest systems I have seen.
  - Dario -