OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
filesize.c
Go to the documentation of this file.
1 #include <sys/types.h>
2 #include <sys/stat.h>
3 
4 /* -------------------------------------------------------------- */
5 /* filesize() - returns file length in bytes */
6 
7 /* -------------------------------------------------------------- */
8 int32_t filesize(const char *filename) {
9  struct stat buf;
10  int32_t ret;
11 
12  ret = stat(filename, &buf);
13  if (ret < 0)
14  return (ret);
15  else
16  return (buf.st_size);
17 }
18 
19 int32_t filesize_(const char *filename) {
20  return (filesize(filename));
21 }
int32_t filesize(const char *filename)
Definition: filesize.c:8
char filename[FILENAME_MAX]
Definition: atrem_corl1.h:122
int32_t filesize_(const char *filename)
Definition: filesize.c:19