[llvm-commits] CVS: llvm/lib/System/Darwin/Path.cpp
Reid Spencer
reid at x10sys.com
Mon Aug 30 14:47:06 PDT 2004
Changes in directory llvm/lib/System/Darwin:
Path.cpp updated: 1.1 -> 1.2
---
Log message:
Move the GetTemporaryDirectory function from "generic Unix" to platform
specific.
---
Diffs of the changes: (+12 -0)
Index: llvm/lib/System/Darwin/Path.cpp
diff -u llvm/lib/System/Darwin/Path.cpp:1.1 llvm/lib/System/Darwin/Path.cpp:1.2
--- llvm/lib/System/Darwin/Path.cpp:1.1 Sun Aug 29 00:24:01 2004
+++ llvm/lib/System/Darwin/Path.cpp Mon Aug 30 16:46:55 2004
@@ -31,6 +31,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