By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,731 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,731 IT Pros & Developers. It's quick & easy.

how to Open Sub Directory to access a file in linux

P: 4
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..................can anyone help
Dec 17 '10 #1
Share this Question
Share on Google+
1 Reply


100+
P: 256
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.

http://www.boost.org/doc/libs/1_45_0.../doc/index.htm

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++!
Dec 17 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.