How to open folders via c++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bluesteel
    New Member
    • Mar 2007
    • 84

    How to open folders via c++

    Hi guys, I am currently triying to open folders by writing a program.

    Using system() i should be able to open an specific folder but i can't.

    i have tried using cd somefolder, cd.., cd\, cd /d but i cannot, any idea??
    How should i do???
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    check out the stdio.h library.

    Comment

    • bluesteel
      New Member
      • Mar 2007
      • 84

      #3
      Originally posted by RedSon
      check out the stdio.h library.
      what do you mean??? Can I open folders using stdio.h????

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        Originally posted by bluesteel
        what do you mean??? Can I open folders using stdio.h????
        stdio.h has methods for you to use to open/close and traverse directories on the system. There is no such thing as opening a folder to a computer program. You are opening a file not a folder. All the words between the slashes are just the path to the file.

        Comment

        • DeMan
          Top Contributor
          • Nov 2006
          • 1799

          #5
          stdio.h works with standard input/ouput including file handling (which means dirs too).

          using system....are you working from the command line or from an IDE?
          (you can also access files using there complete path, and may not need to change directories)

          Comment

          Working...