clsync
Loading...
Searching...
No Matches
fileutils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * fd2fpath_malloc (int fd)
 
int fileutils_copy (const char *path_from, const char *path_to)
 Copies file.
 
short int fileutils_calcdirlevel (const char *path)
 Calculates directory level of a canonized path (actually it just counts "/"-s)
 
int mkdirat_open (const char *const dir_path, int dirfd_parent, mode_t dir_mode)
 Combination of mkdirat() and openat()
 
uint32_t stat_diff (stat64_t *a, stat64_t *b)
 

Function Documentation

◆ fd2fpath_malloc()

char * fd2fpath_malloc ( int fd)
extern

Definition at line 26 of file fileutils.c.

◆ fileutils_calcdirlevel()

short int fileutils_calcdirlevel ( const char * path)
extern

Calculates directory level of a canonized path (actually it just counts "/"-s)

Parameters
[in]pathCanonized path (with realpath())
Return values
zeroor prositive Direcory level
negativeGot error, while calculation. Error-code is placed to errno.

Definition at line 138 of file fileutils.c.

Here is the caller graph for this function:

◆ fileutils_copy()

int fileutils_copy ( const char * path_from,
const char * path_to )
extern

Copies file.

Parameters
[in]path_fromSource file path
[in]path_toDestination file path
Return values
zeroSuccessfully copied
non-zeroGot error, while copying

Definition at line 78 of file fileutils.c.

Here is the caller graph for this function:

◆ mkdirat_open()

int mkdirat_open ( const char *const dir_path,
int dirfd_parent,
mode_t dir_mode )
extern

Combination of mkdirat() and openat()

Parameters
[in]dir_pathPath to directory to create and open
[in]dirfd_parentFile descriptor of directory for relative paths
[in]dir_modeModes for newly created directory (e.g. 750)
Return values
dirfdFile descriptor to newly created directory
NULLOn error

Definition at line 179 of file fileutils.c.

Here is the caller graph for this function:

◆ stat_diff()

uint32_t stat_diff ( stat64_t * a,
stat64_t * b )
extern

Definition at line 219 of file fileutils.c.

Here is the caller graph for this function: