Toggle navigation
Ocean Color Science Software
Jump to content
ocssw
V2022
web
ocssw
ocssw_src
oel_util
libgenutils
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
}
filesize
int32_t filesize(const char *filename)
Definition:
filesize.c:8
filename
char filename[FILENAME_MAX]
Definition:
atrem_corl1.h:122
filesize_
int32_t filesize_(const char *filename)
Definition:
filesize.c:19