Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

Directory Functions
[SB Library]

Directory Functions. More...

Defines

#define LAST_CHAR(buf)   buf[strlen(buf)-1]
 get last char of buffer
#define DIRSEP   '/'
 define directory seperator here

Functions

int sb_dir_is_dir (char *dirpath)
 Check if path is a directory.
int sb_dir_remove (char *dirpath)
 Remove one directory if it is empty.
int sb_dir_mkdirs (const char *pathname, mode_t mode, int *error)
 Make directories and all missing parent directories.
int sb_dir_rmdirs (char *dirname)
 Remove directories and file recursivly.

Detailed Description

Directory Functions.

This module provides functions for handling directories.


Function Documentation

int sb_dir_is_dir char *  dirpath  ) 
 

Check if path is a directory.

Parameters:
dirpath Path to directory
Returns:
1 if successful, and 0 otherwise

Definition at line 51 of file dir.c.

Referenced by mntd_volume_g_build_mntpnt(), mntd_volume_mount(), sb_dir_mkdirs(), sb_dir_remove(), and sb_dir_rmdirs().

int sb_dir_mkdirs const char *  pathname,
mode_t  mode,
int *  error
 

Make directories and all missing parent directories.

Parameters:
pathname Path to make
mode creating mask of permissions
error Pointer to error return value
Returns:
0 if successful, and <0 otherwise

Definition at line 83 of file dir.c.

References sb_dir_is_dir().

Referenced by mntd_volume_mount().

int sb_dir_remove char *  dirpath  ) 
 

Remove one directory if it is empty.

Parameters:
dirpath Path to directory
Returns:
0 if successful, and -1 otherwise

Definition at line 69 of file dir.c.

References sb_dir_is_dir().

Referenced by mntd_volume_mount(), and mntd_volume_umount().

int sb_dir_rmdirs char *  dirname  ) 
 

Remove directories and file recursivly.

Parameters:
dirname Root directory from which file and directories will be removed recursivly
Returns:
0 if successful, and -1 otherwise

Definition at line 149 of file dir.c.

References LAST_CHAR, sb_dir_is_dir(), sb_file_is_file(), and sb_file_remove().

Referenced by mntd_volume_mount().


Generated on Wed Mar 30 13:43:27 2005 for Mntd by  doxygen 1.3.9.1