summaryrefslogtreecommitdiff
path: root/nuttx/examples/nsh/nsh_fscmds.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-07-01 19:22:54 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-07-01 19:22:54 +0000
commit83fb5545a1eb49bcd1bfcf36140e676d772ceef9 (patch)
tree23b526c1237944f7c1b4b736fbe8fe6d44b45a06 /nuttx/examples/nsh/nsh_fscmds.c
parent5f2d898113f8991a6894c4db2133115cfbbe3c05 (diff)
downloadpx4-nuttx-83fb5545a1eb49bcd1bfcf36140e676d772ceef9.tar.gz
px4-nuttx-83fb5545a1eb49bcd1bfcf36140e676d772ceef9.tar.bz2
px4-nuttx-83fb5545a1eb49bcd1bfcf36140e676d772ceef9.zip
Add rm and rmdir commandsChangeLog
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@304 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nsh/nsh_fscmds.c')
-rw-r--r--nuttx/examples/nsh/nsh_fscmds.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/nuttx/examples/nsh/nsh_fscmds.c b/nuttx/examples/nsh/nsh_fscmds.c
index f8f95d39c..a40120d8f 100644
--- a/nuttx/examples/nsh/nsh_fscmds.c
+++ b/nuttx/examples/nsh/nsh_fscmds.c
@@ -684,6 +684,34 @@ void cmd_mount(int argc, char **argv)
#endif
/****************************************************************************
+ * Name: cmd_rm
+ ****************************************************************************/
+
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
+void cmd_rm(int argc, char **argv)
+{
+ if (unlink(argv[1]) < 0)
+ {
+ printf(g_fmtcmdfailed, argv[0], "unlink", strerror(errno));
+ }
+}
+#endif
+
+/****************************************************************************
+ * Name: cmd_rm
+ ****************************************************************************/
+
+#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
+void cmd_rmdir(int argc, char **argv)
+{
+ if (rmdir(argv[1]) < 0)
+ {
+ printf(g_fmtcmdfailed, argv[0], "rmdir", strerror(errno));
+ }
+}
+#endif
+
+/****************************************************************************
* Name: cmd_umount
****************************************************************************/