// prototypes for functions provided for testing system // Beth Katz, September 2004 // You should modify this file to contain prototypes for functions you create // for your testing system. Put function comments here for documentation. // Do *NOT* have 'using namespace std;' here. Instead, fully qualify the names. #include #include // returns whether or not file exists; works with file and directory names int fileExists(const char * fileName); // looks through the directory of the given name and stores the names // of the regular files in the directory as strings in a vector // code adapted from submit.c in GRASST void fillFileList(const char * directoryName, std::vector & fileList); // print a description and then the contents of the fileList vector void printFileList(const std::string & description, const std::vector & fileList); // returns a string containing the processID of this process std::string processIDstring( ); // execute prog with input from inputDir/inputFile and save output in outputFile // cputime and filesize limits imposed to decrease effect of runaway programs // -t 2 means two seconds cputime and -f 10 means a filesize of 10 KB int runProgram(const std::string & prog, const std::string & inputDir, const std::string & inputFile, const std::string & outputFile); // remove fileToRemove from file system int removeFile(const std::string & fileToRemove);