Boost logo

Boost Users :

From: Peng Yu (pengyu.ut_at_[hidden])
Date: 2006-10-30 08:24:57


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net