boost filesystem: acessing files with their extensions
- hello every one, can anyone please tell me is there any way to find the files in a directory with some exension say .txt,.doc, .cpp etc ......and then use them ???? all help is appreciated mohan gupta
Mohan gupta wrote:
hello every one, can anyone please tell me is there any way to find the files in a directory with some exension say .txt,.doc, .cpp etc ......and then use them ???? all help is appreciated mohan gupta namespace bfs=boost::filesystem;
bfs::path p("/home/user/folder"); bfs::directory_iterator dir_iter(p), dir_end; for(;dir_iter != dir_end; ++dir_iter) { if( bfs::extension(*dir_iter) == ".txt" ) do_something(); elseif( bfs::extension(*dir_iter) == ".doc" ) do_something_different(); } For the most part not my code :-) Cheers, Brad
thank you sir for your reply ..can you please tell me where can i get
the complete documentation or preferably tutorials on boost filesystem
??
i googled a lot and even on the boost filesystem official site i
cudn't get much .
yours thankfully
mohan gupta
On 4/24/08, Brad
Mohan gupta wrote:
hello every one, can anyone please tell me is there any way to find the files in a directory with some exension say .txt,.doc, .cpp etc ......and then use them ???? all help is appreciated mohan gupta namespace bfs=boost::filesystem;
bfs::path p("/home/user/folder"); bfs::directory_iterator dir_iter(p), dir_end; for(;dir_iter != dir_end; ++dir_iter) { if( bfs::extension(*dir_iter) == ".txt" ) do_something(); elseif( bfs::extension(*dir_iter) == ".doc" ) do_something_different(); }
For the most part not my code :-)
Cheers, Brad
On Thu, Apr 24, 2008 at 10:56:05PM +0800, Mohan gupta wrote:
thank you sir for your reply ..can you please tell me where can i get the complete documentation or preferably tutorials on boost filesystem ?? i googled a lot and even on the boost filesystem official site i cudn't get much .
I found http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm by following www.boost.org => Documentation => Libraries 1.35.0 - Current Release => Filesystem Please note that there are some minor errors in the documentation. So I think the function remove_all() mentioned in the tutorial should not be used (does it even exist?) as it is not documented and also the TR2 proposal doesn't mention it. Please report these. I probably have to create a bug report as well as it seems the author doesn't (currently) read the lists. Jens
sir i did read that page ,
put i don think thats complete documentation nether it explains the things
in details as there was no mention of extensions functions there ,,,so isn't
there a complete documentation somewhere????
mohan gupta
On Thu, Apr 24, 2008 at 9:01 PM, Jens Seidel
On Thu, Apr 24, 2008 at 10:56:05PM +0800, Mohan gupta wrote:
thank you sir for your reply ..can you please tell me where can i get the complete documentation or preferably tutorials on boost filesystem ?? i googled a lot and even on the boost filesystem official site i cudn't get much .
I found http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm by following www.boost.org => Documentation => Libraries 1.35.0 - Current Release => Filesystem
Please note that there are some minor errors in the documentation. So I think the function remove_all() mentioned in the tutorial should not be used (does it even exist?) as it is not documented and also the TR2 proposal doesn't mention it.
Please report these. I probably have to create a bug report as well as it seems the author doesn't (currently) read the lists.
Jens _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
The link supplied by Jens contains a horizontal toolbar. There is a link to
reference, which points to:
http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/reference.html
There you can find boost::filesystem::extension function and many more.
With Kind Regards,
Ovanes Markarian
On Thu, Apr 24, 2008 at 6:21 PM, Mohan gupta
sir i did read that page , put i don think thats complete documentation nether it explains the things in details as there was no mention of extensions functions there ,,,so isn't there a complete documentation somewhere???? mohan gupta
On Thu, Apr 24, 2008 at 9:01 PM, Jens Seidel
wrote: On Thu, Apr 24, 2008 at 10:56:05PM +0800, Mohan gupta wrote:
thank you sir for your reply ..can you please tell me where can i get the complete documentation or preferably tutorials on boost filesystem ?? i googled a lot and even on the boost filesystem official site i cudn't get much .
I found http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm by following www.boost.org => Documentation => Libraries 1.35.0 - Current Release => Filesystem
Please note that there are some minor errors in the documentation. So I think the function remove_all() mentioned in the tutorial should not be used (does it even exist?) as it is not documented and also the TR2 proposal doesn't mention it.
Please report these. I probably have to create a bug report as well as it seems the author doesn't (currently) read the lists.
Jens _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
hello sir ,
this is for brad
the code you mailed me gives a compilation error saying extension() is not a
member of scope boost::filesystem .
can u please assist me where is the problem
with regards mohan
On Thu, Apr 24, 2008 at 10:07 PM, Ovanes Markarian
The link supplied by Jens contains a horizontal toolbar. There is a link to reference, which points to: http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/reference.html
There you can find boost::filesystem::extension function and many more.
With Kind Regards, Ovanes Markarian
On Thu, Apr 24, 2008 at 6:21 PM, Mohan gupta
wrote: sir i did read that page , put i don think thats complete documentation nether it explains the things in details as there was no mention of extensions functions there ,,,so isn't there a complete documentation somewhere???? mohan gupta
On Thu, Apr 24, 2008 at 9:01 PM, Jens Seidel
wrote: On Thu, Apr 24, 2008 at 10:56:05PM +0800, Mohan gupta wrote:
thank you sir for your reply ..can you please tell me where can i get the complete documentation or preferably tutorials on boost filesystem ?? i googled a lot and even on the boost filesystem official site i cudn't get much .
I found http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm by following www.boost.org => Documentation => Libraries 1.35.0 - Current Release => Filesystem
Please note that there are some minor errors in the documentation. So I think the function remove_all() mentioned in the tutorial should not be used (does it even exist?) as it is not documented and also the TR2 proposal doesn't mention it.
Please report these. I probably have to create a bug report as well as it seems the author doesn't (currently) read the lists.
Jens _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Thu, Apr 24, 2008 at 11:16 AM, Mohan gupta
the code you mailed me gives a compilation error saying extension() is not a member of scope boost::filesystem .
You need to #include
hello,
can you please tell me whats the comand to compile programs which uses
boost/thread libraries ...on gnu g++ on comand line
( im using fedora core 8)
thank you
mohan gupta
On Fri, Apr 25, 2008 at 10:43 AM, Brad
Jonathan Franklin wrote:
The provided code compiles for me w/ 1.34.1 under msvc 8.0... After fixing one minor type w/ 'elseif'.
Jon
My bad. Thank you Jon. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Sat, Apr 26, 2008 at 12:48 PM, Mohan gupta
can you please tell me whats the comand to compile programs which uses boost/thread libraries ...on gnu g++ on comand line ( im using fedora core 8)
I'm using 1.35, which I built myself, on my linux box (ubuntu Gutsy). The code compiles fine without any bells and whistles using the following command: g++ -I/usr/local/include/boost-1_35 -c foo.cpp Assuming: 1. The boost headers are installed in /usr/local/include/boost-1_35 2. Your source file is foo.cpp I *highly* recommend learning how to use your compiler *before* playing with boost too extensively. Jon
On Sat, Apr 26, 2008 at 2:17 PM, Jonathan Franklin < franklin.jonathan@gmail.com> wrote:
On Sat, Apr 26, 2008 at 12:48 PM, Mohan gupta
wrote: can you please tell me whats the comand to compile programs which uses boost/thread libraries ...on gnu g++ on comand line ( im using fedora core 8)
Just noticed that you said thread, which is different than your original question. Are you: 1. Using the Boost.Thread library, or just want to compile for "multithreaded" 2. Having trouble compiling, linking, or both? Jon
Mohan gupta wrote:
hello, can you please tell me whats the comand to compile programs which uses boost/thread libraries ...on gnu g++ on comand line ( im using fedora core 8) thank you mohan gupta
Mohan, Maybe just try: g++ source.cpp and then post the errors from the compiler here and we'll work through them? Cheers, Brad
participants (5)
-
Brad
-
Jens Seidel
-
Jonathan Franklin
-
Mohan gupta
-
Ovanes Markarian