📄 fdetach.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>fdetach</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_004_173"> </a>NAME</h4><blockquote>fdetach - detach a name from a STREAMS-based file descriptor</blockquote><h4><a name = "tag_000_004_174"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="stropts.h.html">stropts.h</a>>int fdetach(const char *<i>path</i>);</code></pre></blockquote><h4><a name = "tag_000_004_175"> </a>DESCRIPTION</h4><blockquote>The<i>fdetach()</i>function detaches a STREAMS-based file fromthe file to which it was attached by a previous call to<i><a href="fattach.html">fattach()</a></i>.The <i>path</i> argument points to the pathname of the attached STREAMS file.The process must have appropriate privileges or be the owner of the file.A successful call to<i>fdetach()</i>causes all pathnames that named the attached STREAMS file to again name thefile to which the STREAMS file was attached. All subsequent operations on<i>path</i> will operate on the underlying file and not on the STREAMS file.<p>All open file descriptions established while the STREAMS file was attached tothe file referenced by <i>path</i>, will still refer to the STREAMS file afterthe<i>fdetach()</i>has taken effect.<p>If there are no open file descriptors or other references to the STREAMS file,then a successful call to<i>fdetach()</i>has the same effect as performing the last<i><a href="close.html">close()</a></i>on the attached file.</blockquote><h4><a name = "tag_000_004_176"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>fdetach()</i>returns 0. Otherwise, it returns -1and sets <i>errno</i> to indicate the error.</blockquote><h4><a name = "tag_000_004_177"> </a>ERRORS</h4><blockquote>The<i>fdetach()</i>function will fail if:<dl compact><dt>[EACCES]<dd>Search permission is denied on a component of the path prefix.<dt>[EPERM]<dd>The effective user ID is not the owner of <i>path</i> andthe process does not have appropriate privileges.<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>[EINVAL]<dd>The <i>path</i> argument names a file that is not currently attached.<dt>[ENAMETOOLONG]<dd>The size of a pathname exceeds {PATH_MAX}, or a pathnamecomponent is longer than {NAME_MAX}.<dt>[ELOOP]<dd>Too many symbolic links were encountered in resolving <i>path</i>.</dl><p>The<i>fdetach()</i>function may fail if:<dl compact><dt>[ENAMETOOLONG]<dd>Pathname resolution of a symbolic link produced an intermediate result whoselength exceeds {PATH_MAX}.</dl></blockquote><h4><a name = "tag_000_004_178"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_004_179"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_004_180"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_004_181"> </a>SEE ALSO</h4><blockquote><i><a href="fattach.html">fattach()</a></i>,<i><a href="stropts.h.html"><stropts.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 + -