1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2019-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2021-2023 Nanook Consulting All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
* Creates a directory tree set to the specified permissions.
*
* The pmix_os_dirpath_create() function creates a directory
* tree, with each directory that is created in the tree having the specified
* access permissions. Existing directories within the tree are left
* untouched - however, if they do not permit the user to create a directory
* within them, the function will return an error condition.
*
* If the specified full path name already exists, the
* pmix_os_dirpath_create() function will check to ensure that
* the final directory in the tree has at least the specified access permission. In other
* words, if the directory has read-write-execute for all, and the user
* has requested read-write access for just the user, then the function
* will consider the directory acceptable. If the minimal permissions are
* not currently provided, the function will attempt to change the
* access permissions of the directory to add the specified
* permissions. The function will return PMIX_ERROR if this cannot
* be done.
**/
/**
* @param path A pointer to a string that contains the path name to be built.
* @param mode A mode_t bit mask that specifies the access permissions for the
* directories being constructed.
* @retval PMIX_SUCCESS If the directory tree has been successfully created with
* the specified access permissions.
* @retval PMIX_ERROR If the directory tree could not be created with the
* specified access permissions.
*/
PMIX_EXPORT int ;
/**
* Check to see if a directory is empty
*
* @param path A pointer to a string that contains the path name to be checked.
*
* @retval true If the directory is empty
* @retval false If the directory is not empty
*/
PMIX_EXPORT bool ;
/**
* Stale function left for PRRTE backward compatility
*/
PMIX_EXPORT int ;
/**
* Callback for pmix_os_dirpath_destroy(). Call for every file/directory before
* taking action to remove/unlink it.
*
* @param root A pointer to a string that contains the base path name (e.g., /tmp/foo from
* /tmp/foo/bar)
* @param path A pointer to a string that contains the file or directory (e.g., bar from
* /tmp/foo/bar)
*
* @retval true Allow the program to remove the file/directory
* @retval false Do not allow the program to remove the file/directory
*/
typedef bool ;
/**
* Destroy a directory
*
* @param path A pointer to a string that contains the path name to be destroyed
* @param recursive Recursively descend the directory removing all files and directories.
* if set to 'false' then the directory must be empty to succeed.
* @param cbfunc A function that will be called before removing a file or directory.
* If NULL, then assume all remove.
*
* @retval PMIX_SUCCESS If the directory was successfully removed or removed to the
* specification of the user (i.e., obeyed the callback function).
* @retval PMIX_ERR_NOT_FOUND If directory does not exist.
* @retval PMIX_ERROR If the directory cannot be removed, accessed properly, or contains
* directories that could not be removed..
*/
PMIX_EXPORT int ;