📄 ftell.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>ftell</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_005_338"> </a>NAME</h4><blockquote>ftell, ftello - return a file offset in a stream</blockquote><h4><a name = "tag_000_005_339"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="stdio.h.html">stdio.h</a>>long int ftell(FILE *<i>stream</i>);off_t ftello(FILE *<i>stream</i>);</code></pre></blockquote><h4><a name = "tag_000_005_340"> </a>DESCRIPTION</h4><blockquote>The<i>ftell()</i>function obtains the current value of the file-position indicatorfor the stream pointed to by<i>stream</i>.<p>The<i>ftello()</i>function is identical to<i>ftell()</i>except that the return value is of type<b>off_t</b>.</blockquote><h4><a name = "tag_000_005_341"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>ftell()</i>and<i>ftello()</i>return the current value of the file-position indicatorfor the stream measured in bytes from the beginning of the file.<p>Otherwise,<i>ftell()</i>and<i>ftello()</i>return -1, cast to<b>long</b>and<b>off_t</b>respectively, and set<i>errno</i>to indicate the error.</blockquote><h4><a name = "tag_000_005_342"> </a>ERRORS</h4><blockquote>The<i>ftell()</i>and<i>ftello()</i>functions will fail if:<dl compact><dt>[EBADF]<dd>The file descriptor underlying<i>stream</i>is not an open file descriptor.<dt>[EOVERFLOW]<dd>For<i>ftell()</i>,the current file offset cannot be represented correctly in an objectof type <b>long</b>.<dt>[EOVERFLOW]<dd>For<i>ftello()</i>,the current file offset cannot be represented correctly in an objectof type <b>off_t</b>.<dt>[ESPIPE]<dd>The file descriptor underlying<i>stream</i>is associated with a pipe or FIFO.</dl></blockquote><h4><a name = "tag_000_005_343"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_344"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_345"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_346"> </a>SEE ALSO</h4><blockquote><i><a href="fgetpos.html">fgetpos()</a></i>,<i><a href="fopen.html">fopen()</a></i>,<i><a href="fseek.html">fseek()</a></i>,<i>ftello()</i>,<i><a href="lseek.html">lseek()</a></i>,<i><a href="stdio.h.html"><stdio.h></a></i>,and the <b>XNS</b> specification description of<i><a href="../xns/ftell.html">ftell()</a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</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 + -