doc
Main Page
Related Pages
Topics
Data Structures
Files
File List
Globals
src
std
c_dir.h
Go to the documentation of this file.
1
/*
2
* cynapses libc functions
3
*
4
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
/**
22
* @file c_dir.h
23
*
24
* @brief Interface of the cynapses libc directory function
25
*
26
* @defgroup cynDirInternals cynapses libc directory functions
27
* @ingroup cynLibraryAPI
28
*
29
* @{
30
*/
31
32
#ifndef _C_DIR_H
33
#define _C_DIR_H
34
35
#include <sys/types.h>
36
37
38
/**
39
* @brief Create parent directories as needed.
40
*
41
* The newly created directory will be owned by the effective user ID of the
42
* process.
43
*
44
* @param path The path to the directory to create.
45
*
46
* @param mode Specifies the permissions to use. It is modified
47
* by the process's umask in the usual way: the
48
* permissions of the created file are (mode & ~umask).
49
*
50
* @return 0 on success, < 0 on error with errno set:
51
* - EACCES The parent directory does not allow write
52
* permission to the process, or one of the directories
53
* - ENOTDIR if durl is not a directory
54
* - EINVAL NULL durl passed or smbc_init not called.
55
* - ENOMEM Insufficient memory was available.
56
*
57
* @see mkdir()
58
*/
59
int
c_mkdirs
(
const
char
*
path
, mode_t
mode
);
60
61
/**
62
* @brief Remove the directory and subdirectories including the content.
63
*
64
* This removes all directories and files recursivly.
65
*
66
* @param dir The directory to remove recusively.
67
*
68
* @return 0 on success, < 0 on error with errno set.
69
*/
70
int
c_rmdirs
(
const
char
*dir);
71
72
/**
73
* @brief Check if a path is a directory.
74
*
75
* @param path The path to check.
76
*
77
* @return 1 if the path is a directory, 0 if the path doesn't exist, is a
78
* file or can't be accessed.
79
*/
80
int
c_isdir
(
const
char
*
path
);
81
82
/**
83
* }@
84
*/
85
#endif
/* _CDIR_H */
86
path
char path[1]
Definition
csync_private.h:11
mode
mode_t mode
Definition
csync_private.h:7
c_isdir
int c_isdir(const char *path)
Check if a path is a directory.
c_rmdirs
int c_rmdirs(const char *dir)
Remove the directory and subdirectories including the content.
c_mkdirs
int c_mkdirs(const char *path, mode_t mode)
Create parent directories as needed.
Generated by
1.10.0