Chdir()

This is a discussion on Chdir() within the C Programming forums, part of the General Programming Boards category; Hello! I start to give an example: I'am running the program in the directorie("/home/big/work2") Then in the middle of the ...

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    29

    Chdir()

    Hello!

    I start to give an example:

    I'am running the program in the directorie("/home/big/work2")

    Then in the middle of the program i change the directorie:
    I've used chdir("FINE");
    And then i want in other part of the program to return to the previous directorie:
    ("/home/big/work2")

    How can i return to the previous directorie without writing the all PATH:/home/big/work2

    Like doing "c.."
    thanks

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    How about "cwd()" to get the current directory before you chdir(), so you can chdir() back again when you're done

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with chdir()
    By ammochck21 in forum C Programming
    Replies: 8
    Last Post: 09-11-2008, 09:26 PM
  2. Couple errors please help :-D
    By JJJIrish05 in forum C Programming
    Replies: 9
    Last Post: 03-06-2008, 01:54 AM
  3. Replies: 12
    Last Post: 04-25-2007, 02:48 PM
  4. how to do...
    By kirmelyte in forum C Programming
    Replies: 1
    Last Post: 05-17-2006, 12:59 AM
  5. chdir()
    By YankeePride13 in forum C++ Programming
    Replies: 3
    Last Post: 11-18-2005, 02:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21