9 #ifndef TGT_OS_TYPE_VXWORKS
10 #include <sys/statvfs.h>
24 if (::rmdir(path) == -1) {
32 if (::unlink(path) == -1) {
40 if (::rename(originPath, destPath) == -1) {
48 if (::getcwd(path, bufferSize) ==
nullptr) {
56 if (::chdir(path) == -1) {
65 #ifdef TGT_OS_TYPE_VXWORKS
66 return Status::NOT_SUPPORTED;
69 static_assert(std::numeric_limits<FwSizeType>::max() >= std::numeric_limits<fsblkcnt_t>::max(),
70 "FwSizeType must be able to hold fsblkcnt_t");
72 "FwSizeType must be able to hold fsblkcnt_t");
73 static_assert(std::numeric_limits<FwSizeType>::max() >= std::numeric_limits<unsigned long>::max(),
74 "FwSizeType must be able to hold unsigned long");
75 struct statvfs fsStat;
76 int ret = statvfs(path, &fsStat);
86 if (free_blocks > (std::numeric_limits<FwSizeType>::max() / block_size) ||
87 total_blocks > (std::numeric_limits<FwSizeType>::max() / block_size)) {
90 freeBytes = free_blocks * block_size;
91 totalBytes = total_blocks * block_size;
97 return &this->m_handle;
static U32 min(const U32 a, const U32 b)
PlatformSizeType FwSizeType
@ OP_OK
Operation was successful.
Status _removeFile(const char *path) override
Remove a file at the specified path.
Status _changeWorkingDirectory(const char *path) override
Change the current working directory to the specified path.
Status _getWorkingDirectory(char *path, FwSizeType bufferSize) override
Get the current working directory.
FileSystemHandle * getHandle() override
Get the raw FileSystem handle.
Status _removeDirectory(const char *path) override
Remove a directory at the specified path.
Status _getFreeSpace(const char *path, FwSizeType &totalBytes, FwSizeType &freeBytes) override
Get filesystem free and total space in bytes on the filesystem containing the specified path.
Status _rename(const char *sourcePath, const char *destPath) override
Rename a file from source to destination.
FileSystem::Status errno_to_filesystem_status(PlatformIntType errno_input)