21 return &this->m_handle;
29 if (::mkdir(path, S_IRWXU) == -1) {
42 DIR* dir = ::opendir(path);
68 struct dirent* direntData =
nullptr;
69 while ((direntData = ::readdir(this->m_handle.
m_dir_descriptor)) !=
nullptr) {
71 if ((direntData->d_name[0] ==
'.' and direntData->d_name[1] ==
'\0') or
72 (direntData->d_name[0] ==
'.' and direntData->d_name[1] ==
'.' and direntData->d_name[2] ==
'\0')) {
79 if (direntData ==
nullptr) {
PlatformSizeType FwSizeType
@ CREATE_IF_MISSING
Create directory if it doesn't exist.
@ CREATE_EXCLUSIVE
Create directory and error if it already exists.
@ OP_OK
Operation was successful.
@ NO_MORE_FILES
Directory stream has no more files.
@ BAD_DESCRIPTOR
Directory stream descriptor is invalid.
@ ALREADY_EXISTS
Directory already exists.
void close() override
Close directory.
DirectoryHandle * getHandle() override
return the underlying mutex handle (implementation specific)
Status rewind() override
Rewind directory stream.
Status read(char *fileNameBuffer, FwSizeType buffSize) override
Get next filename from directory stream.
PosixDirectory()
constructor
Status open(const char *path, OpenMode mode) override
Open or create a directory.
char * string_copy(char *destination, const char *source, FwSizeType num)
copy string with null-termination guaranteed
Directory::Status errno_to_directory_status(PlatformIntType errno_input)