Lines Matching refs:filename
37 static inline bool file_exists(const char* filename) {
39 return os::stat(filename, &st) == 0;
42 static inline void delete_file(const char* filename) {
43 if (!file_exists(filename)) {
46 int ret = remove(filename);
47 EXPECT_TRUE(ret == 0 || errno == ENOENT) << "failed to remove file '" << filename << "': "
76 static inline void init_log_file(const char* filename, const char* options = "") {
78 bool success = LogConfiguration::parse_log_arguments(filename, "logging=trace", "", options, &stream);
79 guarantee(success, "Failed to initialize log file '%s' with options '%s'", filename, options);
81 success = LogConfiguration::parse_log_arguments(filename, "all=off", "", "", &stream);
82 guarantee(success, "Failed to disable logging to file '%s'", filename);
106 static bool file_contains_substrings_in_order(const char* filename, const char* substrs[]) {
107 FILE* fp = fopen(filename, "r");
108 assert(fp != NULL, "error opening file %s: %s", filename, strerror(errno));
131 static inline bool file_contains_substring(const char* filename, const char* substr) {
133 return file_contains_substrings_in_order(filename, strs);