Moved removeFile() and getUniqueFilename() into FileUtilities.
[oota-llvm.git] / include / llvm / Support / SystemUtils.h
1 //===- SystemUtils.h - Utilities to do low-level system stuff --*- C++ -*--===//
2 //
3 // This file contains functions used to do a variety of low-level, often
4 // system-specific, tasks.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef SYSTEMUTILS_H
9 #define SYSTEMUTILS_H
10
11 #include <string>
12
13 /// isExecutableFile - This function returns true if the filename specified
14 /// exists and is executable.
15 ///
16 bool isExecutableFile(const std::string &ExeFileName);
17
18 // FindExecutable - Find a named executable, giving the argv[0] of bugpoint.
19 // This assumes the executable is in the same directory as bugpoint itself.
20 // If the executable cannot be found, return an empty string.
21 //
22 std::string FindExecutable(const std::string &ExeName,
23                            const std::string &BugPointPath);
24
25 /// RunProgramWithTimeout - This function executes the specified program, with
26 /// the specified null-terminated argument array, with the stdin/out/err fd's
27 /// redirected, with a timeout specified on the commandline.  This terminates
28 /// the calling program if there is an error executing the specified program.
29 /// It returns the return value of the program, or -1 if a timeout is detected.
30 ///
31 int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args,
32                           const std::string &StdInFile = "",
33                           const std::string &StdOutFile = "",
34                           const std::string &StdErrFile = "");
35
36 #endif