void minifstat(int fd, struct ministat* s) { struct stat st; if (fstat(fd, &st) != 0) die1sys(111, "Could not fstat"); else copystat(s, &st); }
static INT64_T do_stat(const char *path, struct chirp_stat *buf) { debug(D_HDFS, "stat %s", path); hdfsFileInfo *file_info = hdfs_services->stat(fs, path); if(file_info == NULL) return (errno = ENOENT, -1); copystat(buf, file_info, path); hdfs_services->free_stat(file_info, 1); return 0; }
void ministat(const char* path, struct ministat* s) { struct stat st; if (stat(path, &st) != 0) { if (errno == ENOENT) memset(s, 0, sizeof *s); else die3sys(111, "Could not stat '", path, "'"); } else copystat(s, &st); }