Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    moving between folders (boost::filesystem)

    Hello all

    I am trying to "move" from folder to folder. (like: set def ... or cd ..)
    i need a short program (c++) using boost::filesystem to do it (if possible)

    how can i do it if it's not possible using: boost::filesystem

    thanks

  • #2
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Posts
    951
    Thanks
    1
    Thanked 31 Times in 29 Posts
    boost::filesystem doesn't offer this, it just expects you to pass a path object for the directory you want to use (but doesn't actually change the working directory to it).

    You'll have to go to the native API.

    Windows has SetCurrentDirectory from Windows.h.

    Posix (everything else) has chdir() from <unistd.h>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •