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

📄 readlink.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>readlink</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_007_1915">&nbsp;</a>NAME</h4><blockquote>readlink - read the contents of a symbolic link</blockquote><h4><a name = "tag_000_007_1916">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;<a href="unistd.h.html">unistd.h</a>&gt;int readlink(const char *<i>path</i>, char *<i>buf</i>, size_t <i>bufsize</i>);</code></pre></blockquote><h4><a name = "tag_000_007_1917">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>readlink()</i>function places the contents of the symbolic link referred to by <i>path</i> inthe buffer <i>buf</i> which has size <i>bufsize</i>.  If the number of bytes inthe symbolic link is less than <i>bufsize</i>,the contents of the remainder of <i>buf</i> are unspecified.</blockquote><h4><a name = "tag_000_007_1918">&nbsp;</a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>readlink()</i>returns the count of bytes placed in the buffer.  Otherwise, it returns avalue of -1, leaves the buffer unchanged, and sets <i>errno</i> to indicatethe error.</blockquote><h4><a name = "tag_000_007_1919">&nbsp;</a>ERRORS</h4><blockquote>The<i>readlink()</i>function will fail if:<dl compact><dt>[EACCES]<dd>Search permission is denied for a component of the path prefix of <i>path</i>.<dt>[EINVAL]<dd>The <i>path</i> argument names a file that is not a symbolic link.<dt>[EIO]<dd>An I/O error occurred while reading from the file system.<dt>[ENOENT]<dd>A component of <i>path</i> does not name an existing fileor <i>path</i> is an empty string.<dt>[ELOOP]<dd>Too many symbolic links were encountered in resolving <i>path</i>.<dt>[ENAMETOOLONG]<dd>The length of <i>path</i> exceeds {PATH_MAX}, or a pathname component is longerthan {NAME_MAX}.<dt>[ENOTDIR]<dd>A component of the path prefix is not a directory.</dl><p>The<i>readlink()</i>function may fail if:<dl compact><dt>[EACCES]<dd>Read permission is denied for the directory.<dt>[ENAMETOOLONG]<dd>Pathname resolution of a symbolic link produced an intermediate result whoselength exceeds {PATH_MAX}.</dl></blockquote><h4><a name = "tag_000_007_1920">&nbsp;</a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_1921">&nbsp;</a>APPLICATION USAGE</h4><blockquote>Portable applications should not assume that the returned contents of thesymbolic link are null-terminated.</blockquote><h4><a name = "tag_000_007_1922">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>The return value may change in a future issue to align with IEEE PASC.</blockquote><h4><a name = "tag_000_007_1923">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="stat.html">stat()</a></i>,<i><a href="symlink.html">symlink()</a></i>,<i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>

⌨️ 快捷键说明

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