plibsys
Macros | Functions
pfile.h File Reference

File operations. More...

#include <pmacros.h>
#include <ptypes.h>
#include <perror.h>
Include dependency graph for pfile.h:

Go to the source code of this file.

Macros

#define P_DIR_SEPARATOR   "/"
 A directory separator.
 

Functions

P_BEGIN_DECLS P_LIB_API pboolean p_file_is_exists (const pchar *file)
 Checks whether a file exists or not. More...
 
P_LIB_API pboolean p_file_remove (const pchar *file, PError **error)
 Removes a file from the disk. More...
 

Detailed Description

File operations.

Author
Alexander Saprykin

To check file existance use p_file_is_exists(). To remove an exisiting file use p_file_remove().

P_DIR_SEPARATOR provides a platform independent directory separator symbol which you can use to form file or directory path.

Function Documentation

◆ p_file_is_exists()

P_BEGIN_DECLS P_LIB_API pboolean p_file_is_exists ( const pchar file)

Checks whether a file exists or not.

Parameters
fileFile name to check.
Returns
TRUE if the file exists, FALSE otherwise.
Since
0.0.1

On Windows this call doesn't resolve symbolic links, while on UNIX systems does.

◆ p_file_remove()

P_LIB_API pboolean p_file_remove ( const pchar file,
PError **  error 
)

Removes a file from the disk.

Parameters
fileFile name to remove.
[out]errorError report object, NULL to ignore.
Returns
TRUE if the file was successully removed, FALSE otherwise.
Since
0.0.1

This call doesn't resolve symbolic links and remove a symbolic link if the given path points to it.