Changeset 666


Ignore:
Timestamp:
10/04/11 08:38:26 (8 months ago)
Author:
rodel
Message:

-- added missing createFolder function on freebsd platform

Location:
trunk/sources/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/common/include/platform/freebsd/freebsdplatform.h

    r642 r666  
    162162bool deleteFile(string path); 
    163163bool deleteFolder(string path, bool force); 
     164bool createFolder(string path, bool recursive); 
    164165string getHostByName(string name); 
    165166bool isNumeric(string value); 
  • trunk/sources/common/src/platform/freebsd/freebsdplatform.cpp

    r643 r666  
    237237} 
    238238 
     239bool createFolder(string path, bool recursive) { 
     240        string command = format("mkdir %s %s", 
     241                        recursive ? "-p" : "", 
     242                        STR(path)); 
     243        if (system(STR(command)) != 0) { 
     244                FATAL("Unable to create folder %s", STR(path)); 
     245                return false; 
     246        } 
     247 
     248        return true; 
     249} 
     250 
    239251string getHostByName(string name) { 
    240252        struct hostent *pHostEnt = gethostbyname(STR(name)); 
Note: See TracChangeset for help on using the changeset viewer.