140 lines
5.7 KiB
HTML
140 lines
5.7 KiB
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 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-2001<br>
|
|
Copyright © 2001 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 <<a href="../basedefs/dirent.h.html">dirent.h</a>><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> should
|
|
have been returned from an earlier call to <a href="../functions/telldir.html"><i>telldir</i>()</a>. The new position reverts to
|
|
the 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>, or
|
|
if 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 functions
|
|
need 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 describe
|
|
formally, in spite of its intuitive appeal, when systems that use B-trees, hashing functions, or other similar mechanisms to order
|
|
their 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 a
|
|
loop 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 Std 1003.1-2001, <a href=
|
|
"../basedefs/dirent.h.html"><i><dirent.h></i></a>, <a href="../basedefs/stdio.h.html"><i><stdio.h></i></a>, <a href=
|
|
"../basedefs/sys/types.h.html"><i><sys/types.h></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><sys/types.h></i></a> is no longer
|
|
required.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® 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>
|
|
|