28 const char *
const compName
30 FileManagerComponentBase(compName),
43 FileManagerComponentBase::init(queueDepth, instance);
57 CreateDirectory_cmdHandler(
64 this->log_ACTIVITY_HI_CreateDirectoryStarted(logStringDirName);
68 this->log_WARNING_HI_DirectoryCreateError(
73 this->log_ACTIVITY_HI_CreateDirectorySucceeded(logStringDirName);
75 this->emitTelemetry(status);
76 this->sendCommandResponse(opCode, cmdSeq, status);
80 RemoveFile_cmdHandler(
84 const bool ignoreErrors
88 this->log_ACTIVITY_HI_RemoveFileStarted(logStringFileName);
92 this->log_WARNING_HI_FileRemoveError(
96 if (ignoreErrors ==
true) {
98 this->tlmWrite_Errors(this->errorCount);
99 this->cmdResponse_out(
107 this->log_ACTIVITY_HI_RemoveFileSucceeded(logStringFileName);
109 this->emitTelemetry(status);
110 this->sendCommandResponse(opCode, cmdSeq, status);
123 this->log_ACTIVITY_HI_MoveFileStarted(logStringSource, logStringDest);
130 this->log_WARNING_HI_FileMoveError(
131 logStringSource, logStringDest, status
134 this->log_ACTIVITY_HI_MoveFileSucceeded(logStringSource, logStringDest);
136 this->emitTelemetry(status);
137 this->sendCommandResponse(opCode, cmdSeq, status);
141 RemoveDirectory_cmdHandler(
148 this->log_ACTIVITY_HI_RemoveDirectoryStarted(logStringDirName);
152 this->log_WARNING_HI_DirectoryRemoveError(
157 this->log_ACTIVITY_HI_RemoveDirectorySucceeded(logStringDirName);
159 this->emitTelemetry(status);
160 this->sendCommandResponse(opCode, cmdSeq, status);
164 ShellCommand_cmdHandler(
172 this->log_ACTIVITY_HI_ShellCommandStarted(
176 this->systemCall(command, logFileName);
178 this->log_ACTIVITY_HI_ShellCommandSucceeded(
182 this->log_WARNING_HI_ShellCommandFailed(
183 logStringCommand, status
189 this->sendCommandResponse(
197 AppendFile_cmdHandler(
206 this->log_ACTIVITY_HI_AppendFileStarted(logStringSource, logStringTarget);
211 this->log_WARNING_HI_AppendFileFailed(
217 this->log_ACTIVITY_HI_AppendFileSucceeded(
223 this->emitTelemetry(status);
224 this->sendCommandResponse(opCode, cmdSeq, status);
235 this->log_ACTIVITY_HI_FileSizeStarted(logStringFileName);
241 this->log_WARNING_HI_FileSizeError(
246 U64 size =
static_cast<U64>(size_arg);
247 this->log_ACTIVITY_HI_FileSizeSucceeded(logStringFileName, size);
249 this->emitTelemetry(status);
250 this->sendCommandResponse(opCode, cmdSeq, status);
260 this->pingOut_out(0,key);
272 const char evalStr[] =
"eval '%s' 1>>%s 2>&1\n";
274 char buffer[bufferSize];
277 buffer,
sizeof(buffer), evalStr,
283 const int status = system(buffer);
291 ++this->commandCount;
292 this->tlmWrite_CommandsExecuted(this->commandCount);
296 this->tlmWrite_Errors(this->errorCount);
307 this->cmdResponse_out(
311 Fw::CmdResponse::OK :
Fw::CmdResponse::EXECUTION_ERROR
PlatformIntType NATIVE_INT_TYPE
PlatformUIntType NATIVE_UINT_TYPE
#define FW_CMD_STRING_MAX_SIZE
Max character size of command string arguments.
PlatformSizeType FwSizeType
C++-compatible configuration header for fprime configuration.
const char * toChar() const
Status createDirectory(const char *path)
create a new directory at location path
Status moveFile(const char *originPath, const char *destPath)
Status getFileSize(const char *path, FwSizeType &size)
append file origin to destination file. If boolean true, creates a brand new file if the destination ...
Status appendFile(const char *originPath, const char *destPath, bool createMissingDest)
copies a file from origin to destination
@ OP_OK
Operation was successful.
@ OTHER_ERROR
other OS-specific error
Status removeDirectory(const char *path)
remove a directory at location path
Status removeFile(const char *path)
removes a file at location path