28 const char *
const compName
48 CreateDirectory_cmdHandler(
55 this->log_ACTIVITY_HI_CreateDirectoryStarted(logStringDirName);
56 bool errorIfDirExists =
true;
60 this->log_WARNING_HI_DirectoryCreateError(
65 this->log_ACTIVITY_HI_CreateDirectorySucceeded(logStringDirName);
67 this->emitTelemetry(status);
68 this->sendCommandResponse(opCode, cmdSeq, status);
72 RemoveFile_cmdHandler(
76 const bool ignoreErrors
80 this->log_ACTIVITY_HI_RemoveFileStarted(logStringFileName);
84 this->log_WARNING_HI_FileRemoveError(
88 if (ignoreErrors ==
true) {
90 this->tlmWrite_Errors(this->errorCount);
91 this->cmdResponse_out(
99 this->log_ACTIVITY_HI_RemoveFileSucceeded(logStringFileName);
101 this->emitTelemetry(status);
102 this->sendCommandResponse(opCode, cmdSeq, status);
115 this->log_ACTIVITY_HI_MoveFileStarted(logStringSource, logStringDest);
122 this->log_WARNING_HI_FileMoveError(
123 logStringSource, logStringDest, status
126 this->log_ACTIVITY_HI_MoveFileSucceeded(logStringSource, logStringDest);
128 this->emitTelemetry(status);
129 this->sendCommandResponse(opCode, cmdSeq, status);
133 RemoveDirectory_cmdHandler(
140 this->log_ACTIVITY_HI_RemoveDirectoryStarted(logStringDirName);
144 this->log_WARNING_HI_DirectoryRemoveError(
149 this->log_ACTIVITY_HI_RemoveDirectorySucceeded(logStringDirName);
151 this->emitTelemetry(status);
152 this->sendCommandResponse(opCode, cmdSeq, status);
156 ShellCommand_cmdHandler(
164 this->log_ACTIVITY_HI_ShellCommandStarted(
168 this->systemCall(command, logFileName);
170 this->log_ACTIVITY_HI_ShellCommandSucceeded(
174 this->log_WARNING_HI_ShellCommandFailed(
175 logStringCommand,
static_cast<U32
>(status)
181 this->sendCommandResponse(
189 AppendFile_cmdHandler(
198 this->log_ACTIVITY_HI_AppendFileStarted(logStringSource, logStringTarget);
203 this->log_WARNING_HI_AppendFileFailed(
209 this->log_ACTIVITY_HI_AppendFileSucceeded(
215 this->emitTelemetry(status);
216 this->sendCommandResponse(opCode, cmdSeq, status);
227 this->log_ACTIVITY_HI_FileSizeStarted(logStringFileName);
233 this->log_WARNING_HI_FileSizeError(
238 U64 size =
static_cast<U64>(size_arg);
239 this->log_ACTIVITY_HI_FileSizeSucceeded(logStringFileName, size);
241 this->emitTelemetry(status);
242 this->sendCommandResponse(opCode, cmdSeq, status);
252 this->pingOut_out(0,key);
264 const char evalStr[] =
"eval '%s' 1>>%s 2>&1\n";
266 char buffer[bufferSize];
269 buffer,
sizeof(buffer), evalStr,
275 const int status = system(buffer);
283 ++this->commandCount;
284 this->tlmWrite_CommandsExecuted(this->commandCount);
288 this->tlmWrite_Errors(this->errorCount);
299 this->cmdResponse_out(
PlatformIntType NATIVE_INT_TYPE
PlatformUIntType NATIVE_UINT_TYPE
PlatformSignedSizeType FwSignedSizeType
#define FW_CMD_STRING_MAX_SIZE
Max character size of command string arguments.
C++-compatible configuration header for fprime configuration.
@ OK
Command successfully executed.
const char * toChar() const
static Status moveFile(const char *sourcePath, const char *destPath)
Move a file from sourcePath to destPath.
static Status appendFile(const char *sourcePath, const char *destPath, bool createMissingDest=false)
Append the source file to the destination file.
static Status removeFile(const char *path)
Remove a file at the specified path.
static Status removeDirectory(const char *path)
Remove a directory at the specified path.
static Status getFileSize(const char *path, FwSignedSizeType &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.
@ OP_OK
Operation was successful.
Auto-generated base for FileManager component.
@ OTHER_ERROR
A catch-all for other errors. Have to look in implementation-specific code.