summaryrefslogtreecommitdiff
path: root/nuttx/Documentation/NuttShell.html
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-16 14:55:34 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-16 14:55:34 +0000
commitd56eb4669c39b48c458a057298fe5890cff12658 (patch)
treef4313ad1c0c6b07b1257bd5fef3313663f3e955f /nuttx/Documentation/NuttShell.html
parent2266b3b619aeb10b186539341c10d617f326e213 (diff)
downloadnuttx-d56eb4669c39b48c458a057298fe5890cff12658.tar.gz
nuttx-d56eb4669c39b48c458a057298fe5890cff12658.tar.bz2
nuttx-d56eb4669c39b48c458a057298fe5890cff12658.zip
Add to losetup example
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1254 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/Documentation/NuttShell.html')
-rw-r--r--nuttx/Documentation/NuttShell.html12
1 files changed, 11 insertions, 1 deletions
diff --git a/nuttx/Documentation/NuttShell.html b/nuttx/Documentation/NuttShell.html
index 3db617867..c5c5c921b 100644
--- a/nuttx/Documentation/NuttShell.html
+++ b/nuttx/Documentation/NuttShell.html
@@ -954,7 +954,10 @@ losetup [-o <offset>] [-r] &lt;dev-path&gt; &lt;file-path&gt;
<p>
<b>Synopsis</b>.
Setup the loop device at &lt;dev-path&gt; to access the file at &lt;file-path&gt; as a block device.
- Example:
+ In the following example a 256Kb file is created (<code>dd</code>) and <code>losetup</code> is
+ used to make the file accessible as a block device.
+ A FAT file system is created (<code>mkfatfs</code>) and mounted (<code>mount</code>).
+ Files can then be managed on the loop-mounted file.
<ul><pre>
nsh&gt; dd if=/dev/zero of=/tmp/image bs=512 count=512
nsh&gt; ls -l /tmp
@@ -970,6 +973,13 @@ nsh&gt; ls -l /mnt
ls -l /mnt
/mnt:
drw-rw-rw- 0 example/
+nsh&gt; echo &quot;This is a test&quot; &gt;/mnt/example/atest.txt
+nsh&gt; ls -l /mnt/example
+/mnt/example:
+ -rw-rw-rw- 16 ATEST.TXT
+nsh&gt; cat /mnt/example/atest.txt
+This is a test
+nsh&gt;
</pre></ul>
</p>