From c88b844190bf6a6e5e304534cba0d978164167a0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 19 Feb 2014 13:14:39 -0600 Subject: [PATCH] Nodes in the pseudo-filesystem can now be renamed or moved within the pseduo-filesystem --- ChangeLog.txt | 7 +++++-- nshlib/nsh.h | 6 +++--- nshlib/nsh_command.c | 2 +- nshlib/nsh_fscmds.c | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index c5c513d02..cd58a46c7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -825,9 +825,12 @@ (2014-2-10). * apps/examples/nximage/Kconfig and apps/examples/uip/Kconfig: Incomplete Kconfig files fleshed out by Alan Carvalho de Assis (2014-2-18). - * apps/nshilib: rmdir can now be used in the pseudo-filesystem. Hence, + * apps/nshlib: 'rmdir' can now be used in the pseudo-filesystem. Hence, the command needs to be available even if there are no write-able filesystem enabled (2014-2-19). - * apps/nshilib: mkdir can now be used in the pseudo-filesystem. Hence, + * apps/nshlib: 'mkdir' can now be used in the pseudo-filesystem. Hence, the command needs to be available even if there are no write-able filesystem enabled (2014-2-19). + * apps/nshlib: 'rename' can now be used in the pseudo-filesystem. Hence, + the 'mv' command needs to be available even if there are no write-able + filesystem enabled (2014-2-19). diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 97afc430f..223799b41 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -720,6 +720,9 @@ void nsh_usbtrace(void); # ifndef CONFIG_NSH_DISABLE_MKDIR int cmd_mkdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif +# ifndef CONFIG_NSH_DISABLE_MV + int cmd_mv(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); +# endif # ifndef CONFIG_NSH_DISABLE_RMDIR int cmd_rmdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif @@ -752,9 +755,6 @@ void nsh_usbtrace(void); # ifndef CONFIG_NSH_DISABLE_MKRD int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif -# ifndef CONFIG_NSH_DISABLE_MV - int cmd_mv(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); -# endif # ifndef CONFIG_NSH_DISABLE_RM int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c index 447036bc1..a52a91d4a 100644 --- a/nshlib/nsh_command.c +++ b/nshlib/nsh_command.c @@ -300,7 +300,7 @@ static const struct cmdmap_s g_cmdmap[] = # endif #endif -#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE) +#if CONFIG_NFILE_DESCRIPTORS > 0 # ifndef CONFIG_NSH_DISABLE_MV { "mv", cmd_mv, 3, 3, " " }, # endif diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c index ccd831949..c56be9497 100644 --- a/nshlib/nsh_fscmds.c +++ b/nshlib/nsh_fscmds.c @@ -1298,7 +1298,7 @@ int cmd_mksmartfs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) * Name: cmd_mv ****************************************************************************/ -#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE) +#if CONFIG_NFILE_DESCRIPTORS > 0 #ifndef CONFIG_NSH_DISABLE_MV int cmd_mv(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) {