📄 lstat.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>lstat</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_007_478"> </a>NAME</h4><blockquote>lstat - get symbolic link status</blockquote><h4><a name = "tag_000_007_479"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="sysstat.h.html">sys/stat.h</a>>int lstat(const char *<i>path</i>, struct stat *<i>buf</i>);</code></pre></blockquote><h4><a name = "tag_000_007_480"> </a>DESCRIPTION</h4><blockquote>The<i>lstat()</i>function has the same effect as<i><a href="stat.html">stat()</a></i>,except when<i>path</i>refers to a symbolic link. In that case<i>lstat()</i>returns information about the link, while<i><a href="stat.html">stat()</a></i>returns information about the file the link references.<p>For symbolic links, the <b>st_mode</b> member will contain meaningfulinformation when used with the file type macros, and the <b>st_size</b> memberwill contain the length of the pathname contained in the symbolic link.File mode bits and the contents of the remaining members of the statstructure are unspecified. The value returned in the <b>st_size</b> memberis the length of the contents of the symbolic link, and doesnot count any trailing null.</blockquote><h4><a name = "tag_000_007_481"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>lstat()</i>returns 0. Otherwise, it returns -1 and sets <i>errno</i> to indicate theerror.</blockquote><h4><a name = "tag_000_007_482"> </a>ERRORS</h4><blockquote>The<i>lstat()</i>function will fail if:<dl compact><dt>[EACCES]<dd>A component of the path prefix denies search permission.<dt>[EIO]<dd>An error occurred while reading from the file system.<dt>[ELOOP]<dd>Too many symbolic links were encountered in resolving <i>path</i>.<dt>[ENAMETOOLONG]<dd>The length of a pathname exceeds {PATH_MAX}, or pathnamecomponent is longer than {NAME_MAX}.<dt>[ENOTDIR]<dd>A component of the path prefix is not a directory.<dt>[ENOENT]<dd>A component of <i>path</i> does not name an existing fileor <i>path</i> is an empty string.<dt>[EOVERFLOW]<dd>The file size in bytes or the number of blocks allocated to the fileor the file serial number cannot be represented correctly in thestructure pointed to by <i>buf</i>.</dl><p>The<i>lstat()</i>function may fail if:<dl compact><dt>[ENAMETOOLONG]<dd>Pathname resolution of a symbolic link produced an intermediate result whoselength exceeds {PATH_MAX}.<dt>[EOVERFLOW]<dd>One of the members is too large to store into the structure pointed to by the<i>buf</i> argument.</dl></blockquote><h4><a name = "tag_000_007_483"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_484"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_485"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_486"> </a>SEE ALSO</h4><blockquote><i><a href="fstat.html">fstat()</a></i>,<i><a href="readlink.html">readlink()</a></i>,<i><a href="stat.html">stat()</a></i>,<i><a href="symlink.html">symlink()</a></i>,<i><a href="sysstat.h.html"><sys/stat.h></a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 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 + -