[e-lang] [cap-talk] File API taming

Kevin Reid kpreid at mac.com
Fri Apr 10 12:40:44 EDT 2009


On Apr 10, 2009, at 1:56, Stiegler, Marc D wrote:

> The thing I have occasionally found myself wishing I had, which  
> might be a good convenience method (though you can live without it),  
> is getParent(root, file), which would give you the parent of "file"  
> if that parent were in the subtree below "root".

Without introducing any new concepts, we can write  
(root :File).optUnget(file), which would return the path of the file  
relative to that root, if files implemented optUnget/1.

However, to implement getParent in terms of that, you would need to  
manipulate the returned pathname string.

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list