Boost logo

Boost Users :

Subject: [Boost-users] [filesystem] current_path
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2013-07-06 14:21:32


Hello *,

I need to create a relative symlink. To do so I currently use current_path
function:

    auto current_path = fs::current_path();
    BOOST_SCOPE_EXIT(&current_path)
    {
      fs::current_path(current_path);
    }BOOST_SCOPE_EXIT_END

    fs::current_path(some_base_path_here);

    fs::create_symlink
      ( fs::path("..")/some_subdirectory/image_name.filename()
      , original_name.filename()
      )
    ;

 Is there any better way to create a relative symlink?

What happens if I call current_path(whatever) in a multi-threaded
environment? Is it thread-safe or should I synchronize the access to it?

Many thanks,
Ovanes



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