DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2007
    Posts
    2

    accessing LINUX directory tree using C++

    I work on LINUX. I've a directory (say root_dir=/home) and many sub-directories inside it. Using C++, I want to get all those sub-directories name as unicode string and store them in a list data structure provided by the c++.
    can some suggest how to proceed.

    thank u
    ESHWAR

  2. #2
    Join Date
    Nov 2003
    Posts
    4,118
    you can use the dirent library to traverse the current directory and obtain more inforabout each file (e.g., whether the current file is actually a directory): http://www.devx.com/cplus/10MinuteSolution/26748
    You can then store the results in a standard container such as std::list.
    Danny Kalev

Similar Threads

  1. Replies: 6
    Last Post: 09-06-2005, 04:53 PM
  2. Replies: 0
    Last Post: 07-21-2003, 02:17 PM
  3. Directory tree
    By Keith in forum ASP.NET
    Replies: 1
    Last Post: 09-04-2002, 12:16 PM
  4. My view of the world
    By Kevin Moore in forum .NET
    Replies: 55
    Last Post: 02-27-2002, 03:06 PM
  5. accessing a DOM tree element
    By joe crew in forum XML
    Replies: 0
    Last Post: 04-26-2001, 12:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links