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

File Operations

File Operation errors are somewhat of a special case, in that
a "correct" program may attempt an uncompletable file operation.
Some of the operations in question are exactly the operations which
must be performed in order to determine if the operations can be done.
(E.g. Probe-file.)

Because of this I think that special handling of errors is called for.
I would suggest that keyword arguments be added to these functions
which control this behavior.  I would propose two new arguments,
:on-error and :on-failure.  Failure is defined as a reasonable operation
that couldn't be done because of some condition in the outside world,
such as a network being down.  Errors are operations that don't seem
to make sense, such as deleting a file that does not exist, or
supplying a host name that is unknown.  The values to the keyword
arguments would be :error 

arguments would be :ERROR or a value to return.  (With :ERROR being
the default.)  A value of :ERROR would indicate that an error should
be signalled.

This is obviously redundant with handling these situations in the error
system.  However, we won't have an error system generally implemented
for quite some time.  Even then this crude would be useful in simpler
situations, and I think it would be easier to read:
	(probe-file foo :on-failure nil)
	  (si:file-operation-failure nil)
	  (probe-file foo))

Since file operation errors are so pervasive the redundant functionality
would be worth it.