apps/nshlib: Add support for a truncate command. This will be used to test the new ftruncate file system support.

This commit is contained in:
Gregory Nutt
2018-01-04 12:52:17 -06:00
parent 8566a16a82
commit 7a2aac8876
5 changed files with 142 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
/****************************************************************************
* apps/nshlib/nsh_command.c
*
* Copyright (C) 2007-2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -489,6 +489,12 @@ static const struct cmdmap_s g_cmdmap[] =
{ "true", cmd_true, 1, 1, NULL },
#endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0
# ifndef CONFIG_NSH_DISABLE_TRUNCATE
{ "truncate", cmd_truncate, 4, 4, "-s <length> <file-path>" },
# endif
#endif
#ifndef CONFIG_NSH_DISABLE_UNAME
#ifdef CONFIG_NET
{ "uname", cmd_uname, 1, 7, "[-a | -imnoprsv]" },