Andreas Voegele writes:
> How can I catch an exception raised by ->uid or user-info?
>
> The following code always fails (unless the user "foo" exists, of
> course):
>
> (with-errno-handler
> ((errno packet)
> (else 0))
> (->uid "foo"))
I've found out how to catch the exception:
,open handle
(with-handler
(lambda (condition more)
0)
(lambda ()
(->uid "foo")))
Wouldn't it be better to use errno-error, which hides the Scheme48
exception system, instead of error in uid->user-info and
name->user-info in syscalls.scm? Would such a change break existing
code, e.g. the code in scsh.scm?
Or is there another way to find out if a user/group exists?
|