You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
tbm-utils/source/file.c

21 lines
266 B

#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <file.h>
int get_file_size(size_t *size, const char *path)
{
struct stat st;
if (!size || !path)
return -1;
if (stat(path, &st) < 0)
return -1;
*size = st.st_size;
return 0;
}