]> git.donarmstrong.com Git - mothur.git/blobdiff - mothurout.cpp
added compile time default path
[mothur.git] / mothurout.cpp
index 5e0f3d8aaa85842693ef0ad709a1f761cd33ca7d..d3f8e7af788563fa1dd89a401c027175377a98dc 100644 (file)
@@ -40,6 +40,26 @@ void MothurOut::setFileName(string filename)  {
        }\r
 }\r
 /*********************************************************************************************/\r
+void MothurOut::setDefaultPath(string pathname)  {\r
+       try {\r
+       \r
+               //add / to name if needed\r
+               string lastChar = pathname.substr(pathname.length()-1);\r
+               #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
+                       if (lastChar != "/") { pathname += "/"; }\r
+               #else\r
+                       if (lastChar != "\\") { pathname += "\\"; }     \r
+               #endif\r
+               \r
+               defaultPath = pathname;\r
+               \r
+       }\r
+       catch(exception& e) {\r
+               errorOut(e, "MothurOut", "setDefaultPath");\r
+               exit(1);\r
+       }\r
+}\r
+/*********************************************************************************************/\r
 void MothurOut::closeLog()  {\r
        try {\r
                \r