mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
src/system/helpers.cpp:-add file_size function
Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>
This commit is contained in:
@@ -42,6 +42,18 @@
|
||||
#include <system/helpers.h>
|
||||
#include <gui/update_ext.h>
|
||||
|
||||
off_t file_size(const char *filename)
|
||||
{
|
||||
struct stat stat_buf;
|
||||
if(::stat(filename, &stat_buf) == 0)
|
||||
{
|
||||
return stat_buf.st_size;
|
||||
} else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool file_exists(const char *filename)
|
||||
{
|
||||
struct stat stat_buf;
|
||||
|
Reference in New Issue
Block a user