Description Usage Arguments Value
Given a fn
, we may wish to run it on a filepath
, determine
its success, and try again with the parent directory of filepath
,
until we obtain result that is not NULL
. If this does not occur for
any parent directory, we halt with the string error
.
1 | traverse_parent_directories(filepath, fn, error)
|
filepath |
character. The filepath to traverse along. The |
fn |
function. A one-argument function called on |
error |
character or function. A string to error if |
The result of fn
on the first parent directory of
filepath
on which it is not NULL
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.