37 void FileManager ::CreateDirectory_cmdHandler(
const FwOpcodeType opCode,
42 bool errorIfDirExists =
true;
49 this->emitTelemetry(status);
50 this->sendCommandResponse(opCode, cmdSeq, status);
53 void FileManager ::RemoveFile_cmdHandler(
const FwOpcodeType opCode,
56 const bool ignoreErrors) {
62 if (ignoreErrors ==
true) {
71 this->emitTelemetry(status);
72 this->sendCommandResponse(opCode, cmdSeq, status);
75 void FileManager ::MoveFile_cmdHandler(
const FwOpcodeType opCode,
88 this->emitTelemetry(status);
89 this->sendCommandResponse(opCode, cmdSeq, status);
92 void FileManager ::RemoveDirectory_cmdHandler(
const FwOpcodeType opCode,
103 this->emitTelemetry(status);
104 this->sendCommandResponse(opCode, cmdSeq, status);
107 void FileManager ::ShellCommand_cmdHandler(
const FwOpcodeType opCode,
113 int status = this->systemCall(command, logFileName);
123 void FileManager ::AppendFile_cmdHandler(
const FwOpcodeType opCode,
139 this->emitTelemetry(status);
140 this->sendCommandResponse(opCode, cmdSeq, status);
152 U64 size =
static_cast<U64>(size_arg);
155 this->emitTelemetry(status);
156 this->sendCommandResponse(opCode, cmdSeq, status);
159 void FileManager ::pingIn_handler(
const FwIndexType portNum, U32 key) {
170 const char evalStr[] =
"eval '%s' 1>>%s 2>&1\n";
172 char buffer[bufferSize];
181 const int status = system(stringBuffer.toChar());
187 ++this->commandCount;
195 void FileManager ::sendCommandResponse(
const FwOpcodeType opCode,
void log_ACTIVITY_HI_FileSizeSucceeded(const Fw::StringBase &fileName, U64 size) const
void log_ACTIVITY_HI_CreateDirectoryStarted(const Fw::StringBase &dirName) const
FwIdType FwOpcodeType
The type of a command opcode.
void log_ACTIVITY_HI_RemoveDirectorySucceeded(const Fw::StringBase &dirName) const
PlatformSizeType FwSizeType
static Status moveFile(const char *sourcePath, const char *destPath)
Move a file from sourcePath to destPath.
void log_WARNING_HI_FileSizeError(const Fw::StringBase &fileName, U32 status) const
FileManager(const char *const compName)
static Status removeDirectory(const char *path)
Remove a directory at the specified path.
static Status appendFile(const char *sourcePath, const char *destPath, bool createMissingDest=false)
Append the source file to the destination file.
Auto-generated base for FileManager component.
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
void log_ACTIVITY_HI_MoveFileStarted(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName) const
void log_ACTIVITY_HI_AppendFileSucceeded(const Fw::StringBase &source, const Fw::StringBase &target) const
void log_ACTIVITY_HI_CreateDirectorySucceeded(const Fw::StringBase &dirName) const
void log_ACTIVITY_HI_RemoveDirectoryStarted(const Fw::StringBase &dirName) const
void log_ACTIVITY_HI_ShellCommandSucceeded(const Fw::StringBase &command) const
A string backed by an external buffer.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
void log_ACTIVITY_HI_FileSizeStarted(const Fw::StringBase &fileName) const
Command successfully executed.
void log_ACTIVITY_HI_MoveFileSucceeded(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName) const
static Status getFileSize(const char *path, FwSizeType &size)
Get the size of the file (in bytes) at the specified path.
static Status createDirectory(const char *path, bool errorIfAlreadyExists=false)
Create a new directory at the specified path.
void log_WARNING_HI_DirectoryRemoveError(const Fw::StringBase &dirName, U32 status) const
Command had execution error.
const char * toChar() const
void log_ACTIVITY_HI_AppendFileStarted(const Fw::StringBase &source, const Fw::StringBase &target) const
void tlmWrite_Errors(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void log_ACTIVITY_HI_RemoveFileStarted(const Fw::StringBase &fileName) const
void log_ACTIVITY_HI_ShellCommandStarted(const Fw::StringBase &command) const
PlatformIndexType FwIndexType
void log_WARNING_HI_AppendFileFailed(const Fw::StringBase &source, const Fw::StringBase &target, U32 status) const
RateGroupDivider component implementation.
Operation was successful.
#define FW_CMD_STRING_MAX_SIZE
Max character size of command string arguments.
void log_WARNING_HI_ShellCommandFailed(const Fw::StringBase &command, U32 status) const
void log_WARNING_HI_DirectoryCreateError(const Fw::StringBase &dirName, U32 status) const
void log_ACTIVITY_HI_RemoveFileSucceeded(const Fw::StringBase &fileName) const
void log_WARNING_HI_FileMoveError(const Fw::StringBase &sourceFileName, const Fw::StringBase &destFileName, U32 status) const
void tlmWrite_CommandsExecuted(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
static Status removeFile(const char *path)
Remove a file at the specified path.
void log_WARNING_HI_FileRemoveError(const Fw::StringBase &fileName, U32 status) const
FormatStatus
status of string format calls