Lines Matching defs:statbuf

356 UTIL_STATIC int UTIL_setFileStat(const char *filename, stat_t *statbuf)
367 timebuf.modtime = statbuf->st_mtime;
373 timebuf[1].tv_sec = statbuf->st_mtime;
379 res += chown(filename, statbuf->st_uid, statbuf->st_gid); /* Copy ownership */
382 res += chmod(filename, statbuf->st_mode & 07777); /* Copy file permissions */
389 UTIL_STATIC int UTIL_getFDStat(int fd, stat_t *statbuf)
393 r = _fstat64(fd, statbuf);
394 if (r || !(statbuf->st_mode & S_IFREG)) return 0; /* No good... */
396 r = fstat(fd, statbuf);
397 if (r || !S_ISREG(statbuf->st_mode)) return 0; /* No good... */
402 UTIL_STATIC int UTIL_getFileStat(const char* infilename, stat_t *statbuf)
406 r = _stat64(infilename, statbuf);
407 if (r || !(statbuf->st_mode & S_IFREG)) return 0; /* No good... */
409 r = stat(infilename, statbuf);
410 if (r || !S_ISREG(statbuf->st_mode)) return 0; /* No good... */
418 stat_t statbuf;
423 return UTIL_getFDStat(fd, &statbuf); /* Only need to know whether it is a regular file */
429 stat_t statbuf;
430 return UTIL_getFileStat(infilename, &statbuf); /* Only need to know whether it is a regular file */
437 stat_t statbuf;
439 r = _stat64(infilename, &statbuf);
440 if (!r && (statbuf.st_mode & _S_IFDIR)) return 1;
442 r = stat(infilename, &statbuf);
443 if (!r && S_ISDIR(statbuf.st_mode)) return 1;
453 struct UTIL_TYPE_stat statbuf;
460 r = UTIL_fstat(fd, &statbuf);
461 if (r || !UTIL_STAT_MODE_ISREG(statbuf.st_mode)) return 0; /* No good... */
462 return (U64)statbuf.st_size;
469 struct UTIL_TYPE_stat statbuf;
471 r = UTIL_stat(infilename, &statbuf);
472 if (r || !UTIL_STAT_MODE_ISREG(statbuf.st_mode)) return 0; /* No good... */
473 return (U64)statbuf.st_size;