#ifndef _GET_STAT_H #define _GET_STAT_H #include #include #include #include int mu_get_stat(const char *prog_name, const char *path, struct stat *stat_path) { if (stat(path, stat_path)) { fprintf(stderr, "%s: unable to stat %s: %s\n", prog_name, path, strerror(errno)); return 1; } return 0; } int mu_get_lstat(const char *prog_name, const char *path, struct stat *stat_path) { if (lstat(path, stat_path)) { fprintf(stderr, "%s: unable to stat %s: %s\n", prog_name, path, strerror(errno)); return 1; } return 0; } #endif