⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 seekdir.html

📁 IEEE 1003.1-2003, Single Unix Specification v3
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>seekdir</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="seekdir"></a> <a name="tag_03_626"></a><!-- seekdir --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright &copy; 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_626_01"></a>NAME</h4><blockquote>seekdir - set the position of a directory stream</blockquote><h4><a name="tag_03_626_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> #include &lt;<a href="../basedefs/dirent.h.html">dirent.h</a>&gt;<br><br> void seekdir(DIR *</tt><i>dirp</i><tt>, long</tt> <i>loc</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div><tt><br></tt></blockquote><h4><a name="tag_03_626_03"></a>DESCRIPTION</h4><blockquote><p>The <i>seekdir</i>() function shall set the position of the next <a href="../functions/readdir.html"><i>readdir</i>()</a>operation on the directory stream specified by <i>dirp</i> to the position specified by <i>loc</i>. The value of <i>loc</i> shouldhave been returned from an earlier call to <a href="../functions/telldir.html"><i>telldir</i>()</a>. The new position reverts tothe one associated with the directory stream when <a href="../functions/telldir.html"><i>telldir</i>()</a> was performed.</p><p>If the value of <i>loc</i> was not obtained from an earlier call to <a href="../functions/telldir.html"><i>telldir</i>()</a>, orif a call to <a href="../functions/rewinddir.html"><i>rewinddir</i>()</a> occurred between the call to <a href="../functions/telldir.html"><i>telldir</i>()</a> and the call to <i>seekdir</i>(), the results of subsequent calls to <a href="../functions/readdir.html"><i>readdir</i>()</a> are unspecified.</p></blockquote><h4><a name="tag_03_626_04"></a>RETURN VALUE</h4><blockquote><p>The <i>seekdir</i>() function shall not return a value.</p></blockquote><h4><a name="tag_03_626_05"></a>ERRORS</h4><blockquote><p>No errors are defined.</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_626_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_626_07"></a>APPLICATION USAGE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_626_08"></a>RATIONALE</h4><blockquote><p>The original standard developers perceived that there were restrictions on the use of the <i>seekdir</i>() and <a href="../functions/telldir.html"><i>telldir</i>()</a> functions related to implementation details, and for that reason these functionsneed not be supported on all POSIX-conforming systems. They are required on implementations supporting the XSI extension.</p><p>One of the perceived problems of implementation is that returning to a given point in a directory is quite difficult to describeformally, in spite of its intuitive appeal, when systems that use B-trees, hashing functions, or other similar mechanisms to ordertheir directories are considered. The definition of <i>seekdir</i>() and <a href="../functions/telldir.html"><i>telldir</i>()</a>does not specify whether, when using these interfaces, a given directory entry will be seen at all, or more than once.</p><p>On systems not supporting these functions, their capability can sometimes be accomplished by saving a filename found by <a href="../functions/readdir.html"><i>readdir</i>()</a> and later using <a href="../functions/rewinddir.html"><i>rewinddir</i>()</a> and aloop on <a href="../functions/readdir.html"><i>readdir</i>()</a> to relocate the position from which the filename was saved.</p></blockquote><h4><a name="tag_03_626_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_626_10"></a>SEE ALSO</h4><blockquote><p><a href="opendir.html"><i>opendir</i>()</a> , <a href="readdir.html"><i>readdir</i>()</a> , <a href="telldir.html"><i>telldir</i>()</a> , the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/dirent.h.html"><i>&lt;dirent.h&gt;</i></a>, <a href="../basedefs/stdio.h.html"><i>&lt;stdio.h&gt;</i></a>, <a href="../basedefs/sys/types.h.html"><i>&lt;sys/types.h&gt;</i></a></p></blockquote><h4><a name="tag_03_626_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 2.</p></blockquote><h4><a name="tag_03_626_12"></a>Issue 6</h4><blockquote><p>In the SYNOPSIS, the inclusion of <a href="../basedefs/sys/types.h.html"><i>&lt;sys/types.h&gt;</i></a> is no longerrequired.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX &reg; is a registered Trademark of The Open Group.<br>POSIX &reg; is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -