mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
src/system/helpers.cpp:-add file_size function
Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>
Origin commit data
------------------
Commit: 947a277a49
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2013-04-24 (Wed, 24 Apr 2013)
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;
|
||||
|
@@ -27,6 +27,7 @@ int my_system(int argc, const char *arg, ...); /* argc is number of arguments in
|
||||
|
||||
FILE* my_popen( pid_t& pid, const char *cmdstring, const char *type);
|
||||
int safe_mkdir(char * path);
|
||||
off_t file_size(const char *filename);
|
||||
bool file_exists(const char *filename);
|
||||
void wakeup_hdd(const char *hdd_dir);
|
||||
int check_dir(const char * dir);
|
||||
|
Reference in New Issue
Block a user