[llvm-commits] CVS: llvm/lib/System/Linux/Path.cpp
Reid Spencer
reid at x10sys.com
Mon Aug 30 14:47:06 PDT 2004
Changes in directory llvm/lib/System/Linux:
Path.cpp updated: 1.2 -> 1.3
---
Log message:
Move the GetTemporaryDirectory function from "generic Unix" to platform
specific.
---
Diffs of the changes: (+12 -0)
Index: llvm/lib/System/Linux/Path.cpp
diff -u llvm/lib/System/Linux/Path.cpp:1.2 llvm/lib/System/Linux/Path.cpp:1.3
--- llvm/lib/System/Linux/Path.cpp:1.2 Sun Aug 29 00:24:01 2004
+++ llvm/lib/System/Linux/Path.cpp Mon Aug 30 16:46:55 2004
@@ -33,6 +33,18 @@
return true;
}
+Path
+Path::GetTemporaryDirectory() {
+ char pathname[MAXPATHLEN];
+ strcpy(pathname,"/tmp/llvm_XXXXXX");
+ if (0 == mkdtemp(pathname))
+ ThrowErrno(std::string(pathname) + ": Can't create temporary directory");
+ Path result;
+ result.set_directory(pathname);
+ assert(result.is_valid() && "mkdtemp didn't create a valid pathname!");
+ return result;
+}
+
}
// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab
More information about the llvm-commits
mailing list