rcutils
master
C API providing common utilities and data structures.
|
Go to the documentation of this file.
17 #ifndef RCUTILS__FILESYSTEM_H_
18 #define RCUTILS__FILESYSTEM_H_
128 const char * left_hand_path,
129 const char * right_hand_path,
205 const char * directory_path,
234 const char * directory_path,
235 const size_t max_depth,
300 #endif // RCUTILS__FILESYSTEM_H_
bool rcutils_is_file(const char *abs_path)
Check if the provided path points to a file.
struct rcutils_dir_iter_t rcutils_dir_iter_t
An iterator used for enumerating directory contents.
bool rcutils_mkdir(const char *abs_path)
Create the specified directory.
bool rcutils_is_readable(const char *abs_path)
Check if the provided path points to a file/folder readable by current user.
bool rcutils_dir_iter_next(rcutils_dir_iter_t *iter)
Continue iterating over the contents of a directory.
rcutils_dir_iter_t * rcutils_dir_iter_start(const char *directory_path, const rcutils_allocator_t allocator)
Begin iterating over the contents of the specified directory.
bool rcutils_is_directory(const char *abs_path)
Check if the provided path points to a directory.
rcutils_ret_t rcutils_calculate_directory_size_with_recursion(const char *directory_path, const size_t max_depth, uint64_t *size, rcutils_allocator_t allocator)
Calculate the size of the specified directory with recursion.
size_t rcutils_get_file_size(const char *file_path)
Calculate the size of the specifed file.
bool rcutils_get_cwd(char *buffer, size_t max_length)
Return current working directory.
int rcutils_ret_t
The type that holds a return value for an rcutils operation.
Definition: rcutils_ret.h:26
#define RCUTILS_WARN_UNUSED
A macro to make the compiler warn when the return value of a function is not used.
Definition: macros.h:27
bool rcutils_is_writable(const char *abs_path)
Check if the provided path points to a file/folder writable by current user.
An iterator used for enumerating directory contents.
Definition: filesystem.h:249
rcutils_ret_t rcutils_calculate_directory_size(const char *directory_path, uint64_t *size, rcutils_allocator_t allocator)
Calculate the size of the specified directory.
bool rcutils_exists(const char *abs_path)
Check if the provided path points to an existing file/folder.
char * rcutils_to_native_path(const char *path, rcutils_allocator_t allocator)
Return newly allocated string with all argument's "/" replaced by platform specific separator.
Encapsulation of an allocator.
Definition: allocator.h:47
#define RCUTILS_PUBLIC
Definition: visibility_control.h:23
char * rcutils_expand_user(const char *path, rcutils_allocator_t allocator)
Expand user directory in path.
void rcutils_dir_iter_end(rcutils_dir_iter_t *iter)
Finish iterating over the contents of a directory.
char * rcutils_join_path(const char *left_hand_path, const char *right_hand_path, rcutils_allocator_t allocator)
Return newly allocated string with arguments separated by correct delimiter for the platform.
rcutils_allocator_t allocator
The allocator used internally by iteration functions.
Definition: filesystem.h:254
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.
const char * entry_name
The name of the enumerated file or directory.
Definition: filesystem.h:252
void * state
The platform-specific iteration state.
Definition: filesystem.h:256