Atmel Software Framework

fscmds.h File Reference
#include "fs_com.h"
#include "shell.h"

Enumerations

enum  eFsCmdsStatus {
  FSCMDS_STATUS_OK,
  FSCMDS_STATUS_KO,
  FSCMDS_STATUS_ERR_DRIVE,
  FSCMDS_STATUS_ERR_MOUNT,
  FSCMDS_STATUS_ERR_NOMOUNT,
  FSCMDS_STATUS_ERR_UNKNOWNDIR,
  FSCMDS_STATUS_ERR_HW,
  FSCMDS_STATUS_ERR_FS,
  FSCMDS_STATUS_ERR_NOFORMAT,
  FSCMDS_STATUS_ERR_MEMDEVMISSING,
  FSCMDS_STATUS_ERR_NOPARTITION,
  FSCMDS_STATUS_ERR_FSNOTSUPPORTED,
  FSCMDS_STATUS_ERR_FILENOTFOUND,
  FSCMDS_STATUS_ERR_NOTFOUND,
  FSCMDS_STATUS_ERR_NOTAFILE,
  FSCMDS_STATUS_ERR_FILEWR,
  FSCMDS_STATUS_ERR_READONLY,
  FSCMDS_STATUS_ERR_BADSIZEFAT,
  FSCMDS_STATUS_ERR_OUTOFMEM,
  FSCMDS_STATUS_ERR_INCORRECTNAME,
  FSCMDS_STATUS_ERR_ISROOTDIR,
  FSCMDS_STATUS_ERR_DIRNOTEMPTY,
  FSCMDS_STATUS_ERR_MEMALLOC,
  FSCMDS_STATUS_ERR_UNKNOWN
}
 

Functions

eFsCmdsStatus e_fscmds_cd (signed short FsNavId, FS_STRING pcStringDirName)
 The cd basic command. More...
 
eFsCmdsStatus e_fscmds_CheckNavError (void)
 Check the FAT module global var fs_g_status to get the error that occurred in the FAT module. More...
 
eFsCmdsStatus e_fscmds_format (signed short FsNavId, unsigned short u8DriveId)
 The format basic command: format a disk. More...
 
eExecStatus e_fscmds_goto_drive (unsigned int u8DriveId, signed short FsNavId, int ac, signed portCHAR **ppcStringReply)
 Shared mount drive command. More...
 
eFsCmdsStatus e_fscmds_mount (signed short FsNavId, unsigned short u8DriveId)
 The mount basic command: mount a disk. More...
 
eFsCmdsStatus e_fscmds_rm (signed short FsNavId, const FS_STRING pxStringName, bool bOnlyEmpty)
 The rm basic command.
Remove a specified file or a specified directory == rm {-R} {filename,dirname} NOTE: file and directory names can be used with a path. More...
 
eFsCmdsStatus e_fscmds_rm_all (signed short FsNavId, bool bOnlyEmpty)
 The rm all basic command.
Remove all files and directories in current directory == rm {-R} *. More...
 
eExecStatus e_fscmds_shell_append (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_cat (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The cat command: Print the content of a file. Takes one parameter, that is the filename to cat. Format: cat filename. More...
 
eExecStatus e_fscmds_shell_cd (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The cd command: Change directory. Takes one parameter, that is the dest directory. Format: cd dirname. More...
 
eExecStatus e_fscmds_shell_cp (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The cp command: copy a specified file to the bookmarked directory. Takes one parameter, that is the file to copy. Format: cp filename WARNING: paths are not supported; i.e. the parameter must be a filename without path. More...
 
eExecStatus e_fscmds_shell_df (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_disk (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_fat (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_format (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The format command: format the specified drive. Takes one parameter, that is the drive to format. Format: format drive. More...
 
eExecStatus e_fscmds_shell_goto (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The goto command: goto the bookmarked directory. Format: goto. More...
 
eExecStatus e_fscmds_shell_goto_a_drive (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_goto_b_drive (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_goto_c_drive (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_goto_d_drive (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_help (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_ls (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The ls command: list current directory content. Format: ls. More...
 
eExecStatus e_fscmds_shell_mark (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_mkdir (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_fscmds_shell_mount (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The mount command: mount a disk. Takes one parameter, that is the disk letter. Format: mount {a,b,c,d}. More...
 
eExecStatus e_fscmds_shell_mv (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The mv command: rename a file or a directory. Takes two parameters, the file to rename as the first parameter and the new name as second parameter. Format: mv src dst WARNING: paths are not supported; i.e. parameters must be filenames without path. More...
 
eExecStatus e_fscmds_shell_pwd (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The pwd command: return current path. Format: pwd. More...
 
eExecStatus e_fscmds_shell_rm (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The rm command: remove a specified file or a specified directory or all files and directories. Takes up to two parameters, first an optional parameter to recursively delete directories(i.e. non empty directories may be deleted), and always the parameter which is the file to delete or the directory to delete or *. Format: rm {-R} {file,directory,*} NOTE: file and directory names can be used with a path. WARNING: paths are not supported with *; i.e. the command may only be rm -R * or rm *. More...
 
eExecStatus e_fscmds_shell_touch (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eFsCmdsStatus e_fscmds_touch (signed short FsNavId, const FS_STRING pxStringFilename)
 
void v_fscmds_GetStrMsgFromErr (eFsCmdsStatus ErrStatus, signed portCHAR **ppcStringReply)
 Map a string message to an error. More...
 

The exec command return status.

Enumerator
FSCMDS_STATUS_OK 
FSCMDS_STATUS_KO 
FSCMDS_STATUS_ERR_DRIVE 
FSCMDS_STATUS_ERR_MOUNT 
FSCMDS_STATUS_ERR_NOMOUNT 
FSCMDS_STATUS_ERR_UNKNOWNDIR 
FSCMDS_STATUS_ERR_HW 
FSCMDS_STATUS_ERR_FS 
FSCMDS_STATUS_ERR_NOFORMAT 
FSCMDS_STATUS_ERR_MEMDEVMISSING 
FSCMDS_STATUS_ERR_NOPARTITION 
FSCMDS_STATUS_ERR_FSNOTSUPPORTED 
FSCMDS_STATUS_ERR_FILENOTFOUND 
FSCMDS_STATUS_ERR_NOTFOUND 
FSCMDS_STATUS_ERR_NOTAFILE 
FSCMDS_STATUS_ERR_FILEWR 
FSCMDS_STATUS_ERR_READONLY 
FSCMDS_STATUS_ERR_BADSIZEFAT 
FSCMDS_STATUS_ERR_OUTOFMEM 
FSCMDS_STATUS_ERR_INCORRECTNAME 
FSCMDS_STATUS_ERR_ISROOTDIR 
FSCMDS_STATUS_ERR_DIRNOTEMPTY 
FSCMDS_STATUS_ERR_MEMALLOC 
FSCMDS_STATUS_ERR_UNKNOWN 

eFsCmdsStatus e_fscmds_cd ( signed short  FsNavId,
FS_STRING  pxStringDirName 
)

The cd basic command.

Parameters
FsNavIdInput. The file system navigator id to use.
pxStringDirNameInput. The directory name.
Returns
the status of the operation.

References e_fscmds_CheckNavError(), fsaccess_give_mutex(), fsaccess_take_mutex(), FSCMDS_STATUS_OK, nav_select(), and nav_setcwd().

Referenced by e_fscmds_shell_cd().

eFsCmdsStatus e_fscmds_format ( signed short  FsNavId,
unsigned short  u8DriveId 
)

The format basic command: format a disk.

Parameters
FsNavIdInput. The file system navigator id to use.
u8DriveIdInput. The target drive id.
Returns
the status of the operation.

References e_fscmds_CheckNavError(), FS_FORMAT_DEFAULT, fsaccess_give_mutex(), fsaccess_take_mutex(), FSCMDS_STATUS_ERR_DRIVE, FSCMDS_STATUS_OK, nav_drive_format(), nav_drive_get(), nav_drive_nb(), nav_drive_set(), nav_filelist_reset(), nav_partition_mount(), and nav_select().

Referenced by b_mmi_format_a(), b_mmi_format_b(), and e_fscmds_shell_format().

eExecStatus e_fscmds_goto_drive ( unsigned int  u8DriveId,
signed short  FsNavId,
int  ac,
signed portCHAR **  ppcStringReply 
)

Shared mount drive command.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
u8DriveIdInput. The drive id to mount.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. Should be 0.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References e_fscmds_mount(), FSCMDS_ERRMSG_MOUNTSHORT_SYNTAXERROR, FSCMDS_STATUS_OK, NULL, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_fscmds_GetStrMsgFromErr().

Referenced by e_fscmds_shell_goto_a_drive(), e_fscmds_shell_goto_b_drive(), e_fscmds_shell_goto_c_drive(), and e_fscmds_shell_goto_d_drive().

eFsCmdsStatus e_fscmds_mount ( signed short  FsNavId,
unsigned short  u8DriveId 
)

The mount basic command: mount a disk.

Parameters
FsNavIdInput. The file system navigator id to use.
u8DriveIdInput. The target drive id.
Returns
the status of the operation.

References e_fscmds_CheckNavError(), fsaccess_give_mutex(), fsaccess_take_mutex(), FSCMDS_STATUS_ERR_DRIVE, FSCMDS_STATUS_OK, nav_drive_nb(), nav_drive_set(), nav_partition_mount(), and nav_select().

Referenced by e_fscmds_goto_drive(), and e_fscmds_shell_mount().

eFsCmdsStatus e_fscmds_rm ( signed short  FsNavId,
const FS_STRING  pxStringName,
bool  bOnlyEmpty 
)

The rm basic command.
Remove a specified file or a specified directory == rm {-R} {filename,dirname} NOTE: file and directory names can be used with a path.

Parameters
FsNavIdInput. The file system navigator id to use.
pxStringNameInput. The name.
bOnlyEmptyInput. Boolean switch between:
false(=="non-empty directories can be deleted")
and true(=="non-empty directories cannot be deleted")
Returns
the status of the operation.

References e_fscmds_CheckNavError(), fsaccess_give_mutex(), fsaccess_take_mutex(), FSCMDS_STATUS_ERR_NOTFOUND, FSCMDS_STATUS_OK, nav_file_del(), nav_getindex(), nav_gotoindex(), nav_select(), and nav_setcwd().

Referenced by e_fscmds_shell_mv(), and e_fscmds_shell_rm().

eFsCmdsStatus e_fscmds_rm_all ( signed short  FsNavId,
bool  bOnlyEmpty 
)

The rm all basic command.
Remove all files and directories in current directory == rm {-R} *.

Parameters
FsNavIdInput. The file system navigator id to use.
bOnlyEmptyInput. Boolean switch between:
false(=="non-empty directories can be deleted")
and true(=="non-empty directories cannot be deleted") WARNING: paths are not supported with *; i.e. the command may only be rm -R * or rm *
Returns
the status of the operation.

References e_fscmds_CheckNavError(), FS_DIR, FS_FILE, FS_FIND_NEXT, fsaccess_give_mutex(), fsaccess_take_mutex(), FSCMDS_STATUS_OK, nav_file_del(), nav_filelist_first(), nav_filelist_reset(), nav_filelist_set(), and nav_select().

Referenced by e_fscmds_shell_rm().

eExecStatus e_fscmds_shell_append ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)
eExecStatus e_fscmds_shell_cat ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The cat command: Print the content of a file. Takes one parameter, that is the filename to cat. Format: cat filename.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. Should be 1.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References FSCMDS_ERRMSG_CAT_SYNTAXERROR, FSCMDS_STATUS_OK, NULL, prv_cat(), SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_fscmds_GetStrMsgFromErr().

eExecStatus e_fscmds_shell_cd ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The cd command: Change directory. Takes one parameter, that is the dest directory. Format: cd dirname.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. For this command, should be 1.
avInput. The argument vector. For this command, only av[0] is considered.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References e_fscmds_cd(), FSCMDS_ERRMSG_CD_SYNTAXERROR, FSCMDS_STATUS_OK, NULL, pvPortMalloc(), SHELL_ERRMSG_MEMALLOC, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, v_fscmds_GetStrMsgFromErr(), and vPortFree().

eExecStatus e_fscmds_shell_cp ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The cp command: copy a specified file to the bookmarked directory. Takes one parameter, that is the file to copy. Format: cp filename WARNING: paths are not supported; i.e. the parameter must be a filename without path.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. Should be 1.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References FSCMDS_ERRMSG_CP_SYNTAXERROR, FSCMDS_STATUS_OK, NULL, prv_cp(), SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_fscmds_GetStrMsgFromErr().

eExecStatus e_fscmds_shell_df ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)
eExecStatus e_fscmds_shell_disk ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)
eExecStatus e_fscmds_shell_fat ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)
eExecStatus e_fscmds_shell_format ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The format command: format the specified drive. Takes one parameter, that is the drive to format. Format: format drive.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. Should be 1.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References e_fscmds_format(), FSCMDS_ERRMSG_FORMAT_SYNTAXERROR, FSCMDS_ERRMSG_MOUNT_DRIVENOTFOUND, FSCMDS_STATUS_OK, NULL, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_fscmds_GetStrMsgFromErr().

eExecStatus e_fscmds_shell_goto ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The goto command: goto the bookmarked directory. Format: goto.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. Should be 0.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References fsaccess_give_mutex(), fsaccess_take_mutex(), FSCMDS_ERRMSG_GOTO_SYNTAXERROR, nav_gotoindex(), nav_select(), NULL, prv_i_GetIdxFromModid(), prvCommonErrorLeave(), SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_fscmds_GetStrMsgFromErr().

eExecStatus e_fscmds_shell_goto_a_drive ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

References e_fscmds_goto_drive().

eExecStatus e_fscmds_shell_goto_b_drive ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

References e_fscmds_goto_drive().

eExecStatus e_fscmds_shell_goto_c_drive ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

References e_fscmds_goto_drive().

eExecStatus e_fscmds_shell_goto_d_drive ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

References e_fscmds_goto_drive().

eExecStatus e_fscmds_shell_help ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)
eExecStatus e_fscmds_shell_ls ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The ls command: list current directory content. Format: ls.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. Should be 0.
avInput. The argument vector. Ignored.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References FSCMDS_ERRMSG_LS_SYNTAXERROR, FSCMDS_STATUS_OK, NULL, prv_ls(), SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_fscmds_GetStrMsgFromErr().

eExecStatus e_fscmds_shell_mark ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)
eExecStatus e_fscmds_shell_mount ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The mount command: mount a disk. Takes one parameter, that is the disk letter. Format: mount {a,b,c,d}.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. For this command, should be 1.
avInput. The argument vector. For this command, only av[0] is considered.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References e_fscmds_mount(), FSCMDS_ERRMSG_MOUNT_DRIVENOTFOUND, FSCMDS_ERRMSG_MOUNT_SYNTAXERROR, FSCMDS_STATUS_OK, NULL, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_fscmds_GetStrMsgFromErr().

eExecStatus e_fscmds_shell_mv ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The mv command: rename a file or a directory. Takes two parameters, the file to rename as the first parameter and the new name as second parameter. Format: mv src dst WARNING: paths are not supported; i.e. parameters must be filenames without path.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. Should be 2.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References e_fscmds_CheckNavError(), e_fscmds_rm(), fsaccess_give_mutex(), fsaccess_take_mutex(), FSCMDS_ERRMSG_MV_SYNTAXERROR, FSCMDS_ERRMSG_MV_TYPEDIFFER, FSCMDS_STATUS_KO, FSCMDS_STATUS_OK, nav_file_isdir(), nav_file_rename(), nav_getindex(), nav_gotoindex(), nav_select(), nav_setcwd(), NULL, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_fscmds_GetStrMsgFromErr().

eExecStatus e_fscmds_shell_pwd ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The pwd command: return current path. Format: pwd.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. Should be 0.
avInput. The argument vector. Ignored.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References CRLF, e_fscmds_CheckNavError(), fsaccess_give_mutex(), fsaccess_take_mutex(), FSCMDS_ERRMSG_LS_SYNTAXERROR, FSCMDS_STATUS_OK, nav_getcwd(), nav_select(), NULL, prv_Print_String_To_Requester_Stream(), pvPortMalloc(), SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, SHELL_MAX_MSGOUT_LEN, v_fscmds_GetStrMsgFromErr(), v_shell_Print_String_To_Requester_Stream(), and vPortFree().

eExecStatus e_fscmds_shell_rm ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The rm command: remove a specified file or a specified directory or all files and directories. Takes up to two parameters, first an optional parameter to recursively delete directories(i.e. non empty directories may be deleted), and always the parameter which is the file to delete or the directory to delete or *. Format: rm {-R} {file,directory,*} NOTE: file and directory names can be used with a path. WARNING: paths are not supported with *; i.e. the command may only be rm -R * or rm *.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdInput. The file system navigator id to use.
acInput. The argument counter. Should be 1 or 2.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References e_fscmds_rm(), e_fscmds_rm_all(), FSCMDS_ERRMSG_RM_SYNTAXERROR, FSCMDS_STATUS_OK, NULL, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_fscmds_GetStrMsgFromErr().

eExecStatus e_fscmds_shell_touch ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)
void v_fscmds_GetStrMsgFromErr ( eFsCmdsStatus  ErrStatus,
signed portCHAR **  ppcStringReply 
)

Map a string message to an error.

Parameters
ErrStatusInput. The error status.
ppcStringReplyInput/Output. The response string. The input is not NULL.

References FSCMDS_ERRMSG_BADSIZEFAT, FSCMDS_ERRMSG_CD_UNKNOWNDIR, FSCMDS_ERRMSG_DIRNOTEMPTY, FSCMDS_ERRMSG_FILENOTFOUND, FSCMDS_ERRMSG_FILEWR, FSCMDS_ERRMSG_FS, FSCMDS_ERRMSG_FSNOTSUPPORTED, FSCMDS_ERRMSG_HW, FSCMDS_ERRMSG_INCORRECTNAME, FSCMDS_ERRMSG_ISROOTDIR, FSCMDS_ERRMSG_MEMDEVMISSING, FSCMDS_ERRMSG_MOUNT_DRIVENOTFOUND, FSCMDS_ERRMSG_MOUNT_FAILED, FSCMDS_ERRMSG_NOFORMAT, FSCMDS_ERRMSG_NOMOUNT, FSCMDS_ERRMSG_NOPARTITION, FSCMDS_ERRMSG_NOTAFILE, FSCMDS_ERRMSG_NOTFOUND, FSCMDS_ERRMSG_OUTOFMEM, FSCMDS_ERRMSG_READONLYDRIVE, FSCMDS_ERRMSG_UNEXPECTED, FSCMDS_STATUS_ERR_BADSIZEFAT, FSCMDS_STATUS_ERR_DIRNOTEMPTY, FSCMDS_STATUS_ERR_DRIVE, FSCMDS_STATUS_ERR_FILENOTFOUND, FSCMDS_STATUS_ERR_FILEWR, FSCMDS_STATUS_ERR_FS, FSCMDS_STATUS_ERR_FSNOTSUPPORTED, FSCMDS_STATUS_ERR_HW, FSCMDS_STATUS_ERR_INCORRECTNAME, FSCMDS_STATUS_ERR_ISROOTDIR, FSCMDS_STATUS_ERR_MEMALLOC, FSCMDS_STATUS_ERR_MEMDEVMISSING, FSCMDS_STATUS_ERR_MOUNT, FSCMDS_STATUS_ERR_NOFORMAT, FSCMDS_STATUS_ERR_NOMOUNT, FSCMDS_STATUS_ERR_NOPARTITION, FSCMDS_STATUS_ERR_NOTAFILE, FSCMDS_STATUS_ERR_NOTFOUND, FSCMDS_STATUS_ERR_OUTOFMEM, FSCMDS_STATUS_ERR_READONLY, FSCMDS_STATUS_ERR_UNKNOWN, FSCMDS_STATUS_ERR_UNKNOWNDIR, and SHELL_ERRMSG_MEMALLOC.

Referenced by e_fscmds_goto_drive(), e_fscmds_shell_append(), e_fscmds_shell_cat(), e_fscmds_shell_cd(), e_fscmds_shell_cp(), e_fscmds_shell_format(), e_fscmds_shell_goto(), e_fscmds_shell_ls(), e_fscmds_shell_mkdir(), e_fscmds_shell_mount(), e_fscmds_shell_mv(), e_fscmds_shell_pwd(), e_fscmds_shell_rm(), e_fscmds_shell_touch(), and prv_df().