mirror of https://github.com/BOINC/boinc.git
file utilities
git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@995 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
parent
31f0fee320
commit
8ad00421e4
|
@ -116,6 +116,24 @@ _DC_rm(char *name)
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
_DC_file_exists(char *fn)
|
||||
{
|
||||
return(access(fn, F_OK) == 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_DC_file_empty(char *fn)
|
||||
{
|
||||
struct stat s;
|
||||
|
||||
if (stat(fn, &s))
|
||||
return(1);
|
||||
return(s.st_size == 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_DC_create_file(char *fn, char *what)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,8 @@ extern void _DC_init_utils(void);
|
|||
/* Usefull funcs */
|
||||
extern int _DC_mkdir_with_parents(char *dn, mode_t mode);
|
||||
extern int _DC_rm(char *name);
|
||||
extern int _DC_file_exists(char *fn);
|
||||
extern int _DC_file_empty(char *fn);
|
||||
extern int _DC_create_file(char *fn, char *what);
|
||||
extern char *_DC_get_file(char *fn);
|
||||
|
||||
|
|
Loading…
Reference in New Issue