📄 basename.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>basename</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_001_269"> </a>NAME</h4><blockquote>basename - return the last component of a pathname</blockquote><h4><a name = "tag_000_001_270"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="libgen.h.html">libgen.h</a>>char *basename(char *<i>path</i>);</code></pre></blockquote><h4><a name = "tag_000_001_271"> </a>DESCRIPTION</h4><blockquote>The<i>basename()</i>function takes the pathname pointed to by<i>path</i>and returns a pointer to the final component of the pathname, deletingany trailing '/' characters.<p>If the string consists entirely of the '/' character,<i>basename()</i>returns a pointer to the string "/" .<p>If<i>path</i>is a null pointer or points to an empty string,<i>basename()</i>returns a pointer to the string "." .<p>The<i>basename()</i>function may modify the string pointed to by <i>path</i>, and may return apointer to static storage that may then be overwritten by a subsequent call to<i>basename()</i>.<p>This interface need not be reentrant.</blockquote><h4><a name = "tag_000_001_272"> </a>RETURN VALUE</h4><blockquote>The<i>basename()</i>function returns a pointer to the final component of<i>path</i>.</blockquote><h4><a name = "tag_000_001_273"> </a>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4><a name = "tag_000_001_274"> </a>EXAMPLES</h4><blockquote><p><table bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Input String</b><th align=center><b>Output String</b><tr valign=top><td align=left>"/usr/lib"<td align=left>"lib"<tr valign=top><td align=left>"/usr/"<td align=left>"usr"<tr valign=top><td align=left>"/"<td align=left>"/"</table></blockquote><h4><a name = "tag_000_001_275"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_001_276"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_001_277"> </a>SEE ALSO</h4><blockquote><i><a href="dirname.html">dirname()</a></i>,<i><a href="libgen.h.html"><libgen.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 + -