vnstat  2.9
About: vnStat is a console-based network traffic monitor (using the /proc filesystem).
  Fossies Dox: vnstat-2.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

fs.c File Reference
#include "common.h"
#include "id.h"
#include "fs.h"
Include dependency graph for fs.c:

Go to the source code of this file.

Functions

int direxists (const char *dir)
 
int fileexists (const char *file)
 
int mkpath (const char *dir, const mode_t mode)
 
void preparevnstatdir (const char *dir, const char *user, const char *group)
 
void updatedirowner (const char *dir, const char *user, const char *group)
 
void updatedirownerid (const char *dir, const uid_t uid, const gid_t gid)
 

Function Documentation

◆ direxists()

int direxists ( const char *  dir)

Definition at line 5 of file fs.c.

References fileexists().

Referenced by mkpath().

◆ fileexists()

int fileexists ( const char *  file)

Definition at line 10 of file fs.c.

References debug.

Referenced by direxists().

◆ mkpath()

int mkpath ( const char *  dir,
const mode_t  mode 
)

Definition at line 24 of file fs.c.

References cfg, CFG::createdirs, debug, and direxists().

Referenced by preparedirs(), and preparevnstatdir().

◆ preparevnstatdir()

void preparevnstatdir ( const char *  dir,
const char *  user,
const char *  group 
)

Definition at line 88 of file fs.c.

References mkpath(), and updatedirowner().

Referenced by preparedirs().

◆ updatedirowner()

void updatedirowner ( const char *  dir,
const char *  user,
const char *  group 
)

Definition at line 143 of file fs.c.

References cfg, debug, getgroup(), getuser(), hasroot(), updatedirownerid(), and CFG::updatefileowner.

Referenced by preparedirs(), and preparevnstatdir().

◆ updatedirownerid()

void updatedirownerid ( const char *  dir,
const uid_t  uid,
const gid_t  gid 
)

Definition at line 164 of file fs.c.

References cfg, debug, FS_OPEN_RO_FLAGS, hasroot(), and CFG::updatefileowner.

Referenced by updatedirowner().