how to Open Sub Directory to access a file in linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dinesh Sivaling
    New Member
    • Dec 2010
    • 4

    how to Open Sub Directory to access a file in linux

    Hi everyone

    I want to open the Directory like this using C++ in linux

    eg : /proc/1/status

    where proc and 1 is a directory and status is a file,which i want to access(i.e)this file i have to copy to an string to access some information.... ..............c an anyone help
  • mac11
    Contributor
    • Apr 2007
    • 256

    #2
    boost has an excellent filesystem library that I would recommend for any filesystem operations. You'll have to spend a bit of time to become familiar with it, but it saves you headache and nightmare later on.



    If you decide not to use boost there's opendir() and such. 'man opendir' will show you about it and lead you to related functions. But really, prefer boost here since you have C++!

    Comment

    Working...