Skip to content
Permalink
4bc58bfaca
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
14 lines (11 sloc) 304 Bytes
#ifndef __CSE3150_TESTING_EXISTS_H
#define __CSE3150_TESTING_EXISTS_H
#include <string>
#include <sys/stat.h>
// https://stackoverflow.com/a/12774387
inline bool exists (const std::string& name) {
struct stat buffer;
const auto status = stat(name.c_str(), &buffer);
return status == 0;
}
#endif