|
Re: Wild-card Searches of UNIX Directories with Random-Access Iterators
|
Posted: Apr 15, 2005 1:58 AM
|
|
> can tell me what do you need or what does it means > bazokaa
Hi Philip. Sorry about the delay in replying, but Artima's automatic watch notification email system's been a bit flighty of late.
Basically, the article describes a mapping between the UNIX glob() file search function and the STL Random-Access Iterator concept, in the form of the ::unixstl::glob_sequence STL-like pseudo container. (UNIXSTL is a sub-project of STLSoft (http://stlsoft.org/) containing adaptation of UNIX APIs to the STL.)
You can use it as you would any other STL container, in order to process search results via standard algorithms, e.g. the following deletes all the .tmp files from /tmp/junk
::unistl::glob_sequence matches("/tmp/junk/", "*.tmp");
::std::for_each(matches.begin(), matches.end(), ::remove);
Hope that helps. :-)
|
|