The Artima Developer Community
Sponsored Link

Articles Forum
Wild-card Searches of Unix Directories with Random-Access Iterators

2 replies on 1 page. Most recent reply: Sep 12, 2004 9:00 PM by Chuck Allison

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Chuck Allison

Posts: 63
Nickname: cda
Registered: Feb, 2003

Wild-card Searches of Unix Directories with Random-Access Iterators Posted: Sep 12, 2004 9:00 PM
Reply to this message Reply
Advertisement
STL meets glob(): Power, robustness, and genericity without sacrificing efficiency.

http://www.artima.com/cppsource/randomdirectories.html


philip

Posts: 1
Nickname: philip11
Registered: Apr, 2005

Re: Wild-card Searches of UNIX Directories with Random-Access Iterators Posted: Apr 12, 2005 12:57 AM
Reply to this message Reply
can tell me what do you need or what does it means
bazokaa

Matthew Wilson

Posts: 145
Nickname: bigboy
Registered: Jun, 2004

Re: Wild-card Searches of UNIX Directories with Random-Access Iterators Posted: Apr 15, 2005 1:58 AM
Reply to this message Reply
> 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. :-)

Flat View: This topic has 2 replies on 1 page
Topic: Broadcast Once, Watch Anywhere Previous Topic   Next Topic Topic: What's Your Address?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use