suricata
util-path.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "debug.h"
#include "util-debug.h"
#include "util-path.h"
Include dependency graph for util-path.c:

Go to the source code of this file.

Functions

int PathIsAbsolute (const char *path)
 Check if a path is absolute. More...
 
int PathIsRelative (const char *path)
 Check if a path is relative. More...
 
int SCDefaultMkDir (const char *path)
 Wrapper around SCMkDir with default mode arguments. More...
 
int SCCreateDirectoryTree (const char *path, const bool final)
 Recursively create a directory. More...
 
bool SCPathExists (const char *path)
 Check if a path exists. More...
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Definition in file util-path.c.

Function Documentation

int PathIsAbsolute ( const char *  path)

Check if a path is absolute.

Parameters
pathstring with the path
Return values
1absolute
0not absolute

Definition at line 39 of file util-path.c.

Referenced by OutputRegisterFiledataLogger(), PathIsRelative(), and SCConfLogOpenGeneric().

Here is the caller graph for this function:

int PathIsRelative ( const char *  path)

Check if a path is relative.

Parameters
pathstring with the path
Return values
1relative
0not relative

Definition at line 64 of file util-path.c.

References PathIsAbsolute().

Referenced by ConfLoadCompleteIncludePath(), DetectLoadCompleteSigPath(), and SRepLoadFileFromFD().

Here is the call graph for this function:

Here is the caller graph for this function:

int SCCreateDirectoryTree ( const char *  path,
const bool  final 
)

Recursively create a directory.

Parameters
pathPath to create
finaltrue will create the final path component, false will not
Return values
0on success
-1on error

Definition at line 86 of file util-path.c.

References len, SCDefaultMkDir(), and strlcpy().

Here is the call graph for this function:

int SCDefaultMkDir ( const char *  path)

Wrapper around SCMkDir with default mode arguments.

Definition at line 72 of file util-path.c.

References SCMkDir.

Referenced by SCCreateDirectoryTree().

Here is the caller graph for this function:

bool SCPathExists ( const char *  path)

Check if a path exists.

Parameters
Pathto check for existence
Return values
trueif path exists
falseif path does not exist

Definition at line 132 of file util-path.c.