From 8735ef10ed35406d592c283fa3c75b91e4ec934c Mon Sep 17 00:00:00 2001
From: patacongo Command Syntax:
+ Synopsis.
+ Create the directory at
+ Limited to Mounted File Systems.
+ Recall that NuttX uses a pseudo filesystem for its root file
+ system.
+ The Example: Command Syntax:
+ Synopsis.
+ Format a fat file system on the block device specified by Command Syntax:
+ Synopsis.
+ Creates a FIFO character device anywhere in the pseudo file system, creating
+ whatever psuedo directories that may be needed to complete the Example Command Syntax:
+ Synopsis.
+ The 'm ount' command mounts a file system in the NuttX psuedo
+ filesystem. 'mount' performs a three way associating, binding:
+
+ After the the volume has been mounted in the NuttX
+ pseudo filesystem,
+ it may be access in the same way as other objects in thefile system.
+ Example
+
@@ -415,7 +420,7 @@ fi
+
+ Index
+
cd
and pwd
.
All path arguments to commands may be either an absolute path or a
path relative to the current working directory. The current working
- directory is set using the 'cd' command and can be queried either
+ directory is set using the cd
command and can be queried either
by using the pwd
command or by
using the echo
$PWD
command.
@@ -849,6 +854,33 @@ nsh>
+
+mkdir <path>
+
+<path>
.
+ All components of of <path>
except the final directory name must exist on a mounted file
+ system; the final directory must not.
+mkdir
command can only be used to create directories in volumes set up with the
+ mount
command; it cannot be used to create directories in the pseudo filesystem.
+
+nsh> mkdir /mnt/fs/tmp
+nsh> ls -l /mnt/fs
+/mnt/fs:
+ drw-rw-rw- 0 TESTDIR/
+ drw-rw-rw- 0 TMP/
+nsh>
+
+
+
@@ -857,6 +889,18 @@ nsh>
+mkfatfs <path>
+
+<path>
.
+ NSH provides this command to access the mkfatfs()
NuttX API.
+ This block device must reside in the NuttX pseudo filesystem and
+ must have been created by some call to register_blockdriver()
(see include/nuttx/fs.h
).
+
+
@@ -865,6 +909,36 @@ nsh>
+mkfifo <path>
+
+<path>
.
+ By convention, however, device drivers are place in the standard /dev
directory.
+ After it is created, the FIFO device may be used as any other device driver.
+ NSH provides this command to access the mkfifo()
NuttX API.
+
+nsh> ls -l /dev
+/dev:
+ crw-rw-rw- 0 console
+ crw-rw-rw- 0 null
+ brw-rw-rw- 0 ram0
+nsh> mkfifo /dev/fifo
+nsh> ls -l /dev
+ls -l /dev
+/dev:
+ crw-rw-rw- 0 console
+ crw-rw-rw- 0 fifo
+ crw-rw-rw- 0 null
+ brw-rw-rw- 0 ram0
+nsh>
+
+
+
@@ -873,6 +947,65 @@ nsh>
+mount -t <fstype> <block-device>
+<dir-path>
+
+
+<fstype>
' option identifies the type of
+ file system that has been formatted on the <block-device>
.
+ As of this writing, vfat
is the only supported value for <fstype>
+ <block-device>
argument is the full or relative
+ path to a block driver inode in the pseudo filesystem.
+ By convention, this is a name under the /dev
sub-directory.
+ This <block-device>
must have been previously formatted with the same file system
+ type as specified by <fstype>
+ <dir-path>
, is the location in the
+ pseudo filesystem where the mounted volume will appear.
+ This mount point can only reside in the NuttX pseudo filesystem.
+ By convention, this mount point is a subdirectory under /mnt
.
+ The mount command will create whatever psuedo directories that may be needed to complete the
+ full path but the full path must not already exist.
+
+nsh> ls -l /dev
+/dev:
+ crw-rw-rw- 0 console
+ crw-rw-rw- 0 null
+ brw-rw-rw- 0 ram0
+nsh> ls /mnt
+nsh: ls: no such directory: /mnt
+nsh> mount -t vfat /dev/ram0 /mnt/fs
+nsh> ls -l /mnt/fs/testdir
+/mnt/fs/testdir:
+ -rw-rw-rw- 15 TESTFILE.TXT
+nsh> echo "This is a test" >/mnt/fs/testdir/example.txt
+nsh> ls -l /mnt/fs/testdir
+/mnt/fs/testdir:
+-rw-rw-rw- 15 TESTFILE.TXT
+ -rw-rw-rw- 16 EXAMPLE.TXT
+nsh> cat /mnt/fs/testdir/example.txt
+This is a test
+nsh>
+
+
+Command Syntax:
@@ -944,6 +1077,32 @@ nsh>
+rm <file-path> ++
+ Synopsis.
+ Remove the specified <file-path>
name from the mounted file system.
+ Recall that NuttX uses a pseudo filesystem for its root file
+ system.
+ The rm
command can only be used to remove (unlink) files in volumes set up with the
+ mount
command;
+ it cannot be used to remove names in the pseudo filesystem.
+
Example:
++nsh> ls /mnt/fs/testdir +/mnt/fs/testdir: + TESTFILE.TXT + EXAMPLE.TXT +nsh> rm /mnt/fs/testdir/example.txt +nsh> ls /mnt/fs/testdir +/mnt/fs/testdir: + TESTFILE.TXT +nsh> ++
@@ -952,6 +1111,33 @@ nsh> |
+rmdir <dir-path> ++
+ Synopsis.
+ Remove the specified <dir-path>
directory from the mounted file system.
+ Recall that NuttX uses a pseudo filesystem for its root file
+ system.
+ The rmdir
command can only be used to remove directories from volumes set up with the
+ mount
command;
+ it cannot be used to remove directories from the pseudo filesystem.
+
Example:
++nsh> mkdir /mnt/fs/tmp +nsh> ls -l /mnt/fs +/mnt/fs: + drw-rw-rw- 0 TESTDIR/ + drw-rw-rw- 0 TMP/ +nsh> rmdir /mnt/fs/tmp +nsh> ls -l /mnt/fs +/mnt/fs: + drw-rw-rw- 0 TESTDIR/ +nsh> ++
@@ -1021,6 +1207,28 @@ sleep <sec> |
+umount <dir-path> ++
+ Synopsis.
+ Un-mount the file system at mount point <dir-path>
.
+ The umount
command can only be used to un-mount volumes previously mounted using
+ mount
command.
+
Example:
++nsh> ls /mnt/fs +/mnt/fs: + TESTDIR/ +nsh> umount /mnt/fs +nsh> ls /mnt/fs +/mnt/fs: +nsh: ls: no such directory: /mnt/fs +nsh> ++
@@ -1228,28 +1436,28 @@ usleep <usec> | Description | |
---|---|---|
CONFIG_EXAMPLES_NSH_FILEIOSIZE |
+ CONFIG_EXAMPLES_NSH_FILEIOSIZE |
Size of a static I/O buffer used for file access (ignored if there is no filesystem). |
CONFIG_EXAMPLES_NSH_STRERROR |
+ CONFIG_EXAMPLES_NSH_STRERROR |
strerror(errno) makes more readable output but strerror() is very large and will not be used unless this setting is y |
CONFIG_EXAMPLES_NSH_LINELEN |
+ CONFIG_EXAMPLES_NSH_LINELEN |
The maximum length of one command line and of one output line. Default: 80 |
CONFIG_EXAMPLES_NSH_STACKSIZE |
+ CONFIG_EXAMPLES_NSH_STACKSIZE |
The stack size to use when spawning new threads or tasks. Such new threads are generated when a command is executed in background @@ -1257,14 +1465,14 @@ usleep <usec> |
CONFIG_EXAMPLES_NSH_NESTDEPTH |
+ CONFIG_EXAMPLES_NSH_NESTDEPTH |
The maximum number of nested if-then[-else]-fi sequences that
are permissable. Default: 3
|
CONFIG_EXAMPLES_NSH_DISABLESCRIPT |
+ CONFIG_EXAMPLES_NSH_DISABLESCRIPT |
This can be set to y to suppress support for scripting. This
setting disables the sh , test , and [ commands and the
@@ -1273,7 +1481,7 @@ usleep <usec>
|
CONFIG_EXAMPLES_NSH_DISABLEBG |
+ CONFIG_EXAMPLES_NSH_DISABLEBG |
This can be set to y to suppress support for background
commands. This setting disables the nice command prefix and
@@ -1282,14 +1490,14 @@ usleep <usec>
|
CONFIG_EXAMPLES_NSH_CONSOLE |
+ CONFIG_EXAMPLES_NSH_CONSOLE |
If CONFIG_EXAMPLES_NSH_CONSOLE is set to y, then a serial
console front-end is selected.
|
CONFIG_EXAMPLES_NSH_TELNET |
+ CONFIG_EXAMPLES_NSH_TELNET |
If CONFIG_EXAMPLES_NSH_TELNET is set to y, then a TELENET
server front-end is selected. When this option is provided,
@@ -1297,7 +1505,7 @@ usleep <usec>
access NSH.
|
One or both of CONFIG_EXAMPLES_NSH_CONSOLE
and CONFIG_EXAMPLES_NSH_TELNET
@@ -1310,46 +1518,126 @@ usleep <usec>
CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE
CONFIG_EXAMPLES_NSH_IOBUFFER_SIZE
CONFIG_EXAMPLES_NSH_DHCPC
CONFIG_EXAMPLES_NSH_DHCPC
CONFIG_EXAMPLES_NSH_IPADDR
CONFIG_EXAMPLES_NSH_IPADDR
CONFIG_EXAMPLES_NSH_DHCPC
is NOT set, then the static IP
address must be provided.
CONFIG_EXAMPLES_NSH_DRIPADDR
CONFIG_EXAMPLES_NSH_DRIPADDR
CONFIG_EXAMPLES_NSH_NETMASK
CONFIG_EXAMPLES_NSH_NETMASK
CONFIG_EXAMPLES_NSH_NOMAC
CONFIG_EXAMPLES_NSH_NOMAC
+ Index+ |
+