📄 usrlib.html
字号:
<a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>copy</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>copy</i>( )</strong> - copy <i>in</i> (or stdin) to <i>out</i> (or stdout)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS copy ( char * in, /* name of file to read (if NULL assume stdin) */ char * out /* name of file to write (if NULL assume stdout) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command copies from the input file to the output file, until anend-of-file is reached.<p></blockquote><h4>EXAMPLES</h4><blockquote><p><p>The following example displays the file <b>dog</b>, found on the default filedevice:<pre> -> copy <dog</pre>This example copies from the console to the file <b>dog</b>, on device <b>/ct0/</b>,until an EOF (default CTRL-D) is typed:<pre> -> copy >/ct0/dog</pre>This example copies the file <b>dog</b>, found on the default file device, todevice <b>/ct0/</b>:<pre> -> copy <dog >/ct0/dog</pre>This example makes a conventional copy from the file named <b>file1</b> to the filenamed <b>file2</b>:<pre> -> copy "file1", "file2"</pre>Remember that standard input and output are global; therefore, spawningthe first three constructs will not work as expected.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, orERROR if <i>in</i> or <i>out</i> cannot be opened/created, or if there is anerror copying from <i>in</i> to <i>out</i>.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <b><i><a href="./usrLib.html#copyStreams">copyStreams</a></i>( )</b>, <b><i><a href="./tyLib.html#tyEOFSet">tyEOFSet</a></i>( )</b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="copyStreams"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>copyStreams</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>copyStreams</i>( )</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><i><a href="./usrLib.html#copy">copy</a></i>( )</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><b><a href="./usrLib.html#top">usrLib</a></b>, <b><i><a href="./usrLib.html#copy">copy</a></i>( )</b>, <i>VxWorks Programmer's Guide: Target Shell</i><p><hr><a name="diskFormat"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>diskFormat</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>diskFormat</i>( )</strong> - format a disk</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS diskFormat ( char * devName /* name of the device to initialize */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command formats a disk and creates a file system on it. Thedevice must already have been created by the device driver andinitialized for use with a particular file system, via <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>( )</b>or <b><i><a href="./rt11FsLib.html#rt11FsDevInit">rt11FsDevInit</a></i>( )</b>.<p>This command calls <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>( )</b> to perform the FIODISKFORMAT function.<p></blockquote><h4>EXAMPLE</h4><blockquote><p><pre> -> diskFormat "/fd0/"</pre></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the device cannot be opened or formatted.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><a href="./rt11FsLib.html#top">rt11FsLib</a></b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="diskInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>diskInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>diskInit</i>( )</strong> - initialize a file system on a block device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS diskInit ( char * devName /* name of the device to initialize */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command creates a new, blank file system on a block device. Thedevice must already have been created by the device driver andinitialized for use with a particular file system, via <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>( )</b>or <b><i><a href="./rt11FsLib.html#rt11FsDevInit">rt11FsDevInit</a></i>( )</b>.<p>This command calls <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>( )</b> to perform the FIODISKINIT function.<p></blockquote><h4>EXAMPLE</h4><blockquote><p><pre> -> diskInit "/fd0/"</pre></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, orERROR if the device cannot be opened or initialized.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><a href="./rt11FsLib.html#top">rt11FsLib</a></b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="squeeze"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>squeeze</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>squeeze</i>( )</strong> - reclaim fragmented free space on an RT-11 volume</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS squeeze ( char * devName /* RT-11 device to squeeze, e.g., "/fd0/" */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command moves data around on an RT-11 volume so that any areas offree space are merged.<p></blockquote><h4>NOTE</h4><blockquote><p>No device files should be open when this procedure is called.The subsequent condition of such files would be unknown and writing tothem could corrupt the entire disk.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the device cannot be opened or squeezed.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="ld"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ld</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ld</i>( )</strong> - load an object module into memory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>MODULE_ID ld ( int syms, /* -1, 0, or 1 */ BOOL noAbort, /* TRUE = don't abort script on error */ char * name /* name of object module, NULL = standard input */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command loads an object module from a file or from standard input.The object module must be in UNIX <b>a.out</b> format. External references inthe module are resolved during loading. The <i>syms</i> parameter determines howsymbols are loaded; possible values are:<p> 0 - Add global symbols to the system symbol table.<br> 1 - Add global and local symbols to the system symbol table.<br> -1 - Add no symbols to the system symbol table.<p>If there is an error during loading (e.g., externals undefined, too manysymbols, etc.), then <b><i><a href="./shellLib.html#shellScriptAbort">shellScriptAbort</a></i>( )</b> is called to stop any script thatthis routine was called from. If <i>noAbort</i> is TRUE, errors are noted butignored.<p>The normal way of using <b><i><a href="./usrLib.html#ld">ld</a></i>( )</b> is to load all symbols (<i>syms</i> = 1) duringdebugging and to load only global symbols later.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following example loads the <b>a.out</b> file <b>module</b> from the default filedevice into memory, and adds any global symbols to the symbol table:<pre> -> ld <module</pre>This example loads <b>test.o</b> with all symbols:<pre> -> ld 1,0,"test.o"</pre></blockquote><h4>RETURNS</h4><blockquote><p><p><b>MODULE_ID</b>, orNULL if there are too many symbols, the object file format is invalid, orthere is an error reading the file.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <b><a href="./loadLib.html#top">loadLib</a></b>, <i>VxWorks Programmer's Guide: Target Shell, </i>windsh, <i>Tornado User's Guide: Shell</i><hr><a name="ls"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ls</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ls</i>( )</strong> - list the contents of a directory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ls ( char * dirName, /* name of dir to list */ BOOL doLong /* if TRUE, do long listing */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command is similar to UNIX ls. It lists the contents of a directoryin one of two formats. If <i>doLong</i> is FALSE, only the names of the files(or subdirectories) in the specified directory are displayed. If <i>doLong</i>is TRUE, then the file name, size, date, and time are displayed. For a long listing, any entries that describe subdirectories are also flaggedwith the label "DIR".<p>The <i>dirName</i> parameter specifies which directory to list. If<i>dirName</i> is omitted or NULL, the current working directory is listed.<p>Empty directory entries and dosFs volume label entries are not reported.<p></blockquote><h4>NOTE</h4><blockquote><p>When used with <b><a href="./netDrv.html#top">netDrv</a></b> devices (FTP or RSH), <i>doLong</i> has no effect.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>ERRNO</h4><blockquote><p>OK<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <b><i><a href="./usrLib.html#ll">ll</a></i>( )</b>, <b><i><a href="./usrLib.html#lsOld">lsOld</a></i>( )</b>, <b><i><a href="./dirLib.html#stat">stat</a></i>( )</b>, <i>VxWorks Programmer's Guide: Target Shell</i>windsh, <i>Tornado User's Guide: Shell</i><hr><a name="ll"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ll</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ll</i>( )</strong> - do a long listing of directory contents</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ll ( char * dirName /* name of directory to list */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command causes a long listing of a directory's contents to bedisplayed. It is equivalent to:<pre> -> ls dirName, TRUE</pre></blockquote><h4>NOTE</h4><blockquote><p>When used with <b><a href="./netDrv.html#top">netDrv</a></b> devices (FTP or RSH), <b><i><a href="./usrLib.html#ll">ll</a></i>( )</b> does not givedirectory information. It is equivalent to an <b><i><a href="./usrLib.html#ls">ls</a></i>( )</b> call with no long-listing option.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <b><i><a href="./usrLib.html#ls">ls</a></i>( )</b>, <b><i><a href="./dirLib.html#stat">stat</a></i>( )</b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="lsOld"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>lsOld</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>lsOld</i>( )</strong> - list the contents of an RT-11 directory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS lsOld ( char * dirName /* device to list */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command is the old version of <b><i><a href="./usrLib.html#ls">ls</a></i>( )</b>, which used the old-style <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>( )</b>function FIODIRENTRY to get information about entries in a directory.Since VxWorks 5.0, a new version of <b><i><a href="./usrLib.html#ls">ls</a></i>( )</b>, which uses POSIX directory andfile functions, has replaced the older routine.<p>This version remains in the system to support certain drivers that do notcurrently support the POSIX directory and file functions. This includes<b><a href="./netDrv.html#top">netDrv</a></b>, which provides the Remote Shell (RSH) and File Transfer Protocol (FTP) mode remote file access (although <b><a href="./nfsDrv.html#top">nfsDrv</a></b>, which uses NFS, doessupport the directory calls). Also, the new <b><i><a href="./usrLib.html#ls">ls</a></i>( )</b> no longer reports empty
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -