Lines Matching defs:fileName
181 char *ReadFileData(const char *fileName)
183 if (fileName == NULL) {
188 fd = open(fileName, O_RDONLY);
189 INIT_ERROR_CHECK(fd >= 0, return NULL, "Failed to read file %s errno:%d", fileName, errno);
192 return NULL, "Failed to allocate memory for %s", fileName);
196 return NULL, "Failed to read data for %s", fileName);
473 void CheckAndCreateDir(const char *fileName)
476 if (fileName == NULL || *fileName == '\0') {
479 char *path = strndup(fileName, strrchr(fileName, '/') - fileName);
490 (void)fileName;
528 int (*processFile)(const char *fileName, void *context), void *context)
533 char *fileName = calloc(1, MAX_BUF_SIZE);
534 INIT_ERROR_CHECK(fileName != NULL, closedir(pDir);
552 int ret = snprintf_s(fileName, MAX_BUF_SIZE, MAX_BUF_SIZE - 1, "%s/%s", dirPath, dp->d_name);
558 if (stat(fileName, &st) == 0) {
560 processFile(fileName, context);
564 free(fileName);