F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
FileSystem.cpp
Go to the documentation of this file.
1 #include <FpConfig.hpp>
2 #include <Fw/Types/Assert.hpp>
3 #include <Os/File.hpp>
4 #include <Os/FileSystem.hpp>
5 
6 namespace Os {
7 namespace FileSystem {
8 Status createDirectory(const char* path) {
9  return NO_SPACE;
10 } // end createDirectory
11 
12 Status removeDirectory(const char* path) {
13  return INVALID_PATH;
14 } // end removeDirectory
15 
16 Status readDirectory(const char* path, const U32 maxNum, Fw::String fileArray[], U32& numFiles) {
17  numFiles = 0;
18  return OTHER_ERROR;
19 } // end readDirectory
20 
21 Status removeFile(const char* path) {
22  return OTHER_ERROR;
23 } // end removeFile
24 
25 Status moveFile(const char* originPath, const char* destPath) {
26  return OTHER_ERROR;
27 
28 } // end moveFile
29 
31  return OTHER_ERROR;
32 } // end handleFileError
33 
34 Status copyFile(const char* originPath, const char* destPath) {
35  return OTHER_ERROR;
36 } // end copyFile
37 
38 Status getFileSize(const char* path, FwSizeType& size) {
39  return OTHER_ERROR;
40 } // end getFileSize
41 
42 Status changeWorkingDirectory(const char* path) {
43  return OTHER_ERROR;
44 } // end changeWorkingDirectory
45 // Public function to get the file count for a given directory.
46 Status getFileCount(const char* directory, U32& fileCount) {
47  return OTHER_ERROR;
48 } // end getFileCount
49 Status appendFile(const char* originPath, const char* destPath, bool createMissingDest) {
50  return OTHER_ERROR;
51 }
52 Status getFreeSpace(const char* path, FwSizeType& totalBytes, FwSizeType& freeBytes) {
53  return OTHER_ERROR;
54 }
55 } // namespace FileSystem
56 } // namespace Os
PlatformSizeType FwSizeType
Definition: FpConfig.h:30
C++-compatible configuration header for fprime configuration.
Status getFileCount(const char *directory, U32 &fileCount)
counts the number of files in the given directory
Definition: FileSystem.cpp:46
Status getFreeSpace(const char *path, FwSizeType &totalBytes, FwSizeType &freeBytes)
get FS free and total space in bytes on filesystem containing path
Definition: FileSystem.cpp:52
Status handleFileError(File::Status fileStatus)
Definition: FileSystem.cpp:30
Status createDirectory(const char *path)
create a new directory at location path
Definition: FileSystem.cpp:8
Status moveFile(const char *originPath, const char *destPath)
Definition: FileSystem.cpp:25
Status getFileSize(const char *path, FwSizeType &size)
Definition: FileSystem.cpp:38
Status changeWorkingDirectory(const char *path)
move current directory to path
Definition: FileSystem.cpp:42
Status appendFile(const char *originPath, const char *destPath, bool createMissingDest)
copies a file from origin to destination
Definition: FileSystem.cpp:49
@ INVALID_PATH
Path is too long, too many sym links, doesn't exist, ect.
Definition: FileSystem.hpp:22
@ OTHER_ERROR
other OS-specific error
Definition: FileSystem.hpp:25
@ NO_SPACE
No space left.
Definition: FileSystem.hpp:17
Status copyFile(const char *originPath, const char *destPath)
moves a file from origin to destination
Definition: FileSystem.cpp:34
Status removeDirectory(const char *path)
remove a directory at location path
Definition: FileSystem.cpp:12
Status removeFile(const char *path)
removes a file at location path
Definition: FileSystem.cpp:21
Status readDirectory(const char *path, const U32 maxNum, Fw::String fileArray[], U32 &numFiles)
read the contents of a directory. Size of fileArray should be maxNum. Cleaner implementation found in...
Definition: FileSystem.cpp:16