dispaying files

Apr 23, 2010 at 5:15pm
Hello,

I am trying to display all the files/folders in a directory including the files that i do no have permissons to.

Also I am using the BOOST library

Thanks!
Apr 23, 2010 at 8:16pm
I hope your tries will be successful
http://www.cplusplus.com/articles/how_to_ask/
Apr 23, 2010 at 8:36pm
You want to list all the files/folders in a directory, including the files you don't have permission to list? And you haven't told us why.

My recommendation: go find some black-hat hacker forum that hasn't been shut down yet. I'll be waiting to shut it down. :)

[/tease]
Seriously, why do you want to do that?

-Albatross
Last edited on Apr 23, 2010 at 8:37pm
Apr 23, 2010 at 9:47pm
Hey, im actually trying to do something similiar for some hmwk, using the boost library i had to make program that will list all the files with in a directory and set up the command lines so the user can specify which directory, along with that the user has the options to add switches to the command line which change the way the files are listed, these switches are: r to process the all folder recursively, R to list the files in reverse, s to sort the files by ascending file size, and lastly v verbose lists all of the files that i dont have access to process, i have got everything working im just stumped with how to list the extension and size of the files that i cant access
Apr 23, 2010 at 9:48pm
if you're using windows check FindFirstFile, FindNextFile, and FindClose on msdn
( here is an example: http://msdn.microsoft.com/en-us/library/aa365200%28VS.85%29.aspx )
Apr 23, 2010 at 10:37pm
for those who think its for hacking--its not-- i am on my own computer to i could give myself access to the folders if i wanted to see the contents..i want to b able to display the names of the directories that i need permission but I dont want to see whats inside
Apr 23, 2010 at 11:19pm
The Boost Filesystem library is what you want to use.
http://www.boost.org/doc/libs/1_42_0/libs/filesystem/doc/index.htm

basic_directory_iterator
Iterate over the files in a directory
http://www.boost.org/doc/libs/1_42_0/libs/filesystem/doc/reference.html#Class-template-basic_directory_iterator

There are a couple of examples at each link.

Good luck!
Topic archived. No new replies allowed.