rcutils  master
C API providing common utilities and data structures.
filesystem.h
Go to the documentation of this file.
1 // Copyright 2017 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RCUTILS__FILESYSTEM_H_
16 #define RCUTILS__FILESYSTEM_H_
17 
18 #if __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include <stdbool.h>
24 #include <stddef.h>
25 
26 #include "rcutils/macros.h"
28 
30 
39 bool
40 rcutils_get_cwd(char * buffer, size_t max_length);
41 
43 
50 bool
51 rcutils_is_directory(const char * abs_path);
52 
54 
61 bool
62 rcutils_is_file(const char * abs_path);
63 
65 
72 bool
73 rcutils_exists(const char * abs_path);
74 
76 
83 bool
84 rcutils_is_readable(const char * abs_path);
85 
87 
94 bool
95 rcutils_is_writable(const char * abs_path);
96 
98 
105 bool
106 rcutils_is_readable_and_writable(const char * abs_path);
107 
109 
120 char *
121 rcutils_join_path(const char * left_hand_path, const char * right_hand_path);
122 
123 #if __cplusplus
124 }
125 #endif
126 
127 #endif // RCUTILS__FILESYSTEM_H_
bool rcutils_is_readable(const char *abs_path)
Check if the provided path points to a file/folder readable by current user.
bool rcutils_is_readable_and_writable(const char *abs_path)
Check if the provided path points to a file/folder both readable and writable by current user...
char * rcutils_join_path(const char *left_hand_path, const char *right_hand_path)
Return newly allocated string with arguments separated by correct delimiter for the platform...
bool rcutils_exists(const char *abs_path)
Check if the provided path points to an existing file/folder.
bool rcutils_is_writable(const char *abs_path)
Check if the provided path points to a file/folder writable by current user.
bool rcutils_is_directory(const char *abs_path)
Check if the provided path points to a directory.
bool rcutils_get_cwd(char *buffer, size_t max_length)
Return current working directory.
#define RCUTILS_WARN_UNUSED
Definition: macros.h:24
#define RCUTILS_PUBLIC
Definition: visibility_control.h:48
bool rcutils_is_file(const char *abs_path)
Check if the provided path points to a file.