📄 usrfslib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/usrFsLib.html - generated by refgen from usrFsLib.c --> <title> usrFsLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>usrFsLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>usrFsLib</strong> - file system user interface subroutine library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./usrFsLib.html#cd">cd</a>( )</b> - change the default directory<br><b><a href="./usrFsLib.html#pwd">pwd</a>( )</b> - print the current default directory<br><b><a href="./usrFsLib.html#mkdir">mkdir</a>( )</b> - make a directory<br><b><a href="./usrFsLib.html#rmdir">rmdir</a>( )</b> - remove a directory<br><b><a href="./usrFsLib.html#rm">rm</a>( )</b> - remove a file<br><b><a href="./usrFsLib.html#copyStreams">copyStreams</a>( )</b> - copy from/to specified streams<br><b><a href="./usrFsLib.html#copy">copy</a>( )</b> - copy <i>in</i> (or stdin) to <i>out</i> (or stdout)<br><b><a href="./usrFsLib.html#chkdsk">chkdsk</a>( )</b> - perform consistency checking on a MS-DOS file system<br><b><a href="./usrFsLib.html#dirList">dirList</a>( )</b> - list contents of a directory (multi-purpose)<br><b><a href="./usrFsLib.html#ls">ls</a>( )</b> - generate a brief listing of a directory<br><b><a href="./usrFsLib.html#ll">ll</a>( )</b> - generate a long listing of directory contents<br><b><a href="./usrFsLib.html#lsr">lsr</a>( )</b> - list the contents of a directory and any of its subdirectories<br><b><a href="./usrFsLib.html#llr">llr</a>( )</b> - do a long listing of directory and all its subdirectories contents<br><b><a href="./usrFsLib.html#cp">cp</a>( )</b> - copy file into other file/directory.<br><b><a href="./usrFsLib.html#mv">mv</a>( )</b> - mv file into other directory.<br><b><a href="./usrFsLib.html#xcopy">xcopy</a>( )</b> - copy a hierarchy of files with wildcards<br><b><a href="./usrFsLib.html#xdelete">xdelete</a>( )</b> - delete a hierarchy of files with wildcards<br><b><a href="./usrFsLib.html#attrib">attrib</a>( )</b> - modify MS-DOS file attributes on a file or directory<br><b><a href="./usrFsLib.html#xattrib">xattrib</a>( )</b> - modify MS-DOS file attributes of many files<br><b><a href="./usrFsLib.html#diskFormat">diskFormat</a>( )</b> - format a disk<br><b><a href="./usrFsLib.html#diskInit">diskInit</a>( )</b> - initialize a file system on a block device<br><b><a href="./usrFsLib.html#ioHelp">ioHelp</a>( )</b> - print a synopsis of I/O utility functions<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides user-level utilities for managing file systems.These utilities may be used from Tornado Shell, the Target Shell or froman application.<p></blockquote><h4>USAGE FROM TORNADO</h4><blockquote><p>Some of the functions in this library have counterparts of the samenames built into the Tornado Shell (aka Windsh). The built-in functionsperform similar functions on the Tornado host computer's I/O systems.Hence if one of such functions needs to be executed in order to performany operation on the Target's I/O system, it must be preceded with an<b>@</b> sign, e.g.:\ce-> @ls "/sd0"\cewill list the directory of a disk named "/sd0" on the target, wile<pre>-> ls "/tmp"</pre>will list the contents of the "/tmp" directory on the host.<p>The target I/O system and the Tornado Shell running on the host, eachhave their own notion of current directory, which are not related,hence<pre>-> pwd</pre>will display the Tornado Shell current directory on the host filesystem, while<pre>-> @pwd</pre>will display the target's current directory on the target's console.<p></blockquote><h4>WILDCARDS</h4><blockquote><p>Some of the functions herein support wildcard characters in argumentstrings where file or directory names are expected. The wildcards arelimited to "*" which matches zero or more characters and "?" whichmatches any single characters. Files or directories with names beginningwith a "." are not normally matched with the "*" wildcard.<p></blockquote><h4>DIRECTORY LISTING</h4><blockquote><p>Directory listing is implemented in one function <b><a href="./usrFsLib.html#dirList">dirList</a>( )</b>, which can beaccessed using one of these four front-end functions:<p><dl><dt><b><a href="./usrFsLib.html#ls">ls</a>( )</b><dd>produces a short list of files<dt><b><a href="./usrFsLib.html#lsr">lsr</a>( )</b><dd>is like <b><a href="./usrFsLib.html#ls">ls</a>( )</b> but ascends into subdirectories<dt><b><a href="./usrFsLib.html#ll">ll</a>( )</b><dd>produces a detailed list of files, with file size, modification dateattributes etc.<dt><b><a href="./usrFsLib.html#llr">llr</a>( )</b><dd>is like <b><a href="./usrFsLib.html#ll">ll</a>( )</b> but also ascends into subdirectories<p>All of the directory listing functions accept a name of a directory or asingle file to list, or a name which contain wildcards, which willresult in listing of all objects that match the wildcard stringprovided.<br> </dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ioLib.html#top">ioLib</a></b>, <b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><a href="./netDrv.html#top">netDrv</a></b>, <b><a href="./nfsLib.html#top">nfsLib</a></b>,<i>VxWorks Programmer's Guide: Target Shell </i><i>VxWorks Programmer's Guide: Tornado Users's Guide </i><hr><a name="cd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>cd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>cd( )</strong> - change the default directory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS cd ( const char * name /* new directory name */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p><dl><dt>NOTE<dd>This is a target resident function, which manipulates the target I/Osystem. It must be preceded with the<b>@</b> letter if executed from the Tornado Shell (windsh), which has abuilt-in command of the same name that operates on the Host's I/Osystem.<p>This command sets the default directory to <i>name</i>. The default directoryis a device name, optionally followed by a directory local to thatdevice.<p>To change to a different directory, specify one of the following:<dt>-<dd>an entire path name with a device name, possibly followed by a directoryname. The entire path name will be changed.<dt>-<dd>a directory name starting with a <b>~</b> or <b>/</b> or <b>$</b>. The directory partof the path, immediately after the device name, will be replaced with the newdirectory name.<dt>-<dd>a directory name to be appended to the current default directory.The directory name will be appended to the current default directory.</dl><p>An instance of ".." indicates one level up in the directory tree.<p>Note that when accessing a remote file system via RSH or FTP, theVxWorks network device must already have been created using<b><a href="./netDrv.html#netDevCreate">netDevCreate</a>( )</b>.<p></blockquote><h4>WARNING</h4><blockquote><p>The <b><a href="./usrFsLib.html#cd">cd</a>( )</b> command does very little checking that <i>name</i> represents a validpath. If the path is invalid, <b><a href="./usrFsLib.html#cd">cd</a>( )</b> may return OK, but subsequentcalls that depend on the default path will fail.<p></blockquote><h4>EXAMPLES</h4><blockquote><p>The following example changes the directory to device <b>/fd0/</b>:<pre> -> cd "/fd0/"</pre>This example changes the directory to device <b>wrs:</b> with the localdirectory <b>~leslie/target</b>:<pre> -> cd "wrs:~leslie/target"</pre>After the previous command, the following changes the directory to<b>wrs:~leslie/target/config</b>:<pre> -> cd "config"</pre>After the previous command, the following changes the directory to<b>wrs:~leslie/target/demo</b>:<pre> -> cd "../demo"</pre>After the previous command, the following changes the directory to<b>wrs:/etc</b>.<pre> -> cd "/etc"</pre>Note that <b>~</b> can be used only on network devices (RSH or FTP).<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrFsLib.html#top">usrFsLib</a></b>, <b><a href="./usrFsLib.html#pwd">pwd</a>( )</b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="pwd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>pwd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pwd( )</strong> - print the current default directory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void pwd (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command displays the current working device/directory.<p><dl><dt>NOTE<dd>This is a target resident function, which manipulates the target I/Osystem. It must be preceded with the<b>@</b> letter if executed from the Tornado Shell (windsh), which has abuilt-in command of the same name that operates on the Host's I/Osystem.</dl></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrFsLib.html#top">usrFsLib</a></b>, <b><a href="./usrFsLib.html#cd">cd</a>( )</b>, <i>VxWorks Programmer's Guide: Target Shell, </i><b><a href="../../tornado/tools/windsh.html#top" >windsh</a></b>, <i>Tornado User's Guide: Shell</i><hr><a name="mkdir"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>mkdir( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>mkdir( )</strong> - make a directory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mkdir ( const char * dirName /* directory name */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command creates a new directory in a hierarchical file system.The <i>dirName</i> string specifies the name to be used for thenew directory, and can be either a full or relative pathname.<p>This call is supported by the VxWorks NFS and dosFs file systems.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the directory cannot be created.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrFsLib.html#top">usrFsLib</a></b>, <b><a href="./usrFsLib.html#rmdir">rmdir</a>( )</b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="rmdir"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rmdir( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rmdir( )</strong> - remove a directory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rmdir ( const char * dirName /* name of directory to remove */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command removes an existing directory from a hierarchical filesystem. The <i>dirName</i> string specifies the name of the directory tobe removed, and may be either a full or relative pathname.<p>This call is supported by the VxWorks NFS and dosFs file systems.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the directory cannot be removed.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrFsLib.html#top">usrFsLib</a></b>, <b><a href="./usrFsLib.html#mkdir">mkdir</a>( )</b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="rm"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rm( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rm( )</strong> - remove a file</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rm ( const char * fileName /* name of file to remove */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command is provided for UNIX similarity. It simply calls <b><a href="./ioLib.html#remove">remove</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the file cannot be removed.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrFsLib.html#top">usrFsLib</a></b>, <b><a href="./ioLib.html#remove">remove</a>( )</b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="copyStreams"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>copyStreams( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>copyStreams( )</strong> - copy from/to specified streams</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS copyStreams ( int inFd, /* file descriptor of stream to copy from */ int outFd /* file descriptor of stream to copy to */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command copies from the stream identified by <i>inFd</i> to the streamidentified by <i>outFd</i> until an end of file is reached in <i>inFd</i>.This command is used by <b><a href="./usrFsLib.html#copy">copy</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if there is an error reading from <i>inFd</i> or writingto <i>outFd</i>.<p></blockquote><h4>SEE ALSO</h4><blockquote><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -