At 12:37 PM 5/28/2003, Stefan Seefeld wrote:
>hi there,
>
>I'm trying to load a plugin from the same directory the application was
>run from, so I'm doing the following:
>
>
>int main(int argc, char **argv)
>{
>   //...
>   fs::path path(argv[0]);
>   fs::path dir(path.branch_path());
>   //...
>
>
>but as soon as I start the application as './application', I get
>an exception telling me that ...
>
>boost::filesystem::path: invalid name "." in path: "./application"
>
>What am I missing ?

The "." isn't permitted in the generic grammar. There has been some thought about adding it, but no decision yet. It is quite useful on systems which do not automatically included the current directory in the search path.

But in the meantime, for user input, it is usual to allow native platform specific paths, so change to:

fs::path path(argv[0], fs::native );

HTH,

--Beman


_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to