Checking if a directory exists

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emp
    New Member
    • Nov 2006
    • 32

    Checking if a directory exists

    I am writing a logging function.
    Hourly a log entry is made into a directory for the current date.
    Each day a new current date directory is made.

    How can I check to see if a directory exists?
    Is there some way better than systeming off a mkdir?
    I am using g++ in a unix box so the windows CreateDirectory is not an option.

    I had hoped that I could just create a string that contained the complete path including the log file name, open it using the std::ios for append and if the path/file didn't exist, that it would be created. This is not the case.

    Any help would be appreciated


    emp
Working...