
Hi, I have the following program and files .test.seg and test.seg. I try to run the main program. It seems that boost filesystem doesn't recognize file name starting with a dot. Is it a bug in boost filesystem. Or I didn't use it properly? Thanks, Peng $ ls -a . .dep main-g.exe main.o main-o.o .test.seg .. main.cc main-g.o main-o.exe Makefile test.seg $ cat main.cc #include <iostream> #include <boost/filesystem/operations.hpp> // includes boost/filesystem/path.hpp #include <boost/filesystem/fstream.hpp> int main() { if(boost::filesystem::exists("test.seg")) std::cout << "good" << std::endl; if(boost::filesystem::exists(".test.seg")) std::cout << "good1" << std::endl; } $ ./main-g.exe good terminate called after throwing an instance of 'boost::filesystem::filesystem_error' what(): boost::filesystem::path: invalid name ".test.seg" in path: ".test.seg" Aborted

On 10/30/06, Peng Yu <pengyu.ut@gmail.com> wrote:
Hi,
I have the following program and files .test.seg and test.seg. I try to run the main program. It seems that boost filesystem doesn't recognize file name starting with a dot.
Is it a bug in boost filesystem. Or I didn't use it properly?
http://boost.org/libs/filesystem/doc/portability_guide.htm#name_checkĀ_functions If you use the default constructor for path, then it uses a name checker that doesn't allow filenames starting with dots. This was intended to promote portability, but has been found to be a bad idea and will not be in boost 1.34 (nor is it in the tr2 proposal). ~ SWMc

On 10/30/06, me22 <me22.ca@gmail.com> wrote:
On 10/30/06, Peng Yu <pengyu.ut@gmail.com> wrote:
Hi,
I have the following program and files .test.seg and test.seg. I try to run the main program. It seems that boost filesystem doesn't recognize file name starting with a dot.
Is it a bug in boost filesystem. Or I didn't use it properly?
http://boost.org/libs/filesystem/doc/portability_guide.htm#name_checkĀ_functions
If you use the default constructor for path, then it uses a name checker that doesn't allow filenames starting with dots. This was intended to promote portability, but has been found to be a bad idea and will not be in boost 1.34 (nor is it in the tr2 proposal).
There is only version 1.33 online. How can I get 1.34? Thanks, Peng
participants (2)
-
me22
-
Peng Yu