Revision of English help pages for different functions (nothing serious).
[scilab.git] / scilab / modules / fileio / help / en_US / mtell.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - INRIA
5  * ...
6  * 
7  * This file must be used under the terms of the CeCILL.
8  * This source file is licensed as described in the file COPYING, which
9  * you should have received as part of this distribution.  The terms
10  * are also available at    
11  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12  *
13  -->
14 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="mtell">
15     <refnamediv>
16         <refname>mtell</refname>
17         <refpurpose>Returns the offset of the current byte relative to the beginning of a file</refpurpose>
18     </refnamediv>
19     <refsynopsisdiv>
20         <title>Calling Sequence</title>
21         <synopsis>mtell([fd])</synopsis>
22     </refsynopsisdiv>
23     <refsection>
24         <title>Arguments</title>
25         <variablelist>
26             <varlistentry>
27                 <term>fd</term>
28                 <listitem>
29                     <para>
30                         a scalar: a file descriptor returned by the function 
31                         <function>mopen</function>. <literal>-1</literal> 
32                         stands for last opened file. Default value is 
33                         <literal>-1</literal>.
34                     </para>
35                 </listitem>
36             </varlistentry>
37         </variablelist>
38     </refsection>
39     <refsection>
40         <title>Description</title>
41         <para>
42             The function <function>mtell</function> returns the offset of the 
43             current byte  relative  to the beginning of the file associated with 
44             the named stream <varname>fd</varname>.
45         </para>
46     </refsection>
47
48     <refsection>
49         <title>Examples</title>
50         <programlisting role="example"><![CDATA[
51 // Open in binary write a temporary file
52 testFile=TMPDIR + '/testFile.bin';
53 fd = mopen(testFile,'wb');
54
55 mput(42,'d'); // Will write 42 in last opened file
56 mtell() // Will return 8, the current position in the file descriptor
57
58 mput(42+2,'d', fd); // Will open fd transparently to write 42
59 mtell(fd) // Will return 16, the current position in the file descriptor
60
61 mseek(0, fd); // return at the beginning of the file
62 mtell(fd) // Will return 0
63
64 mclose(fd);
65  ]]></programlisting>
66     </refsection>
67
68     <refsection role="see also">
69         <title>See Also</title>
70         <simplelist type="inline">
71             <member>
72                 <link linkend="mclose">mclose</link>
73             </member>
74             <member>
75                 <link linkend="meof">meof</link>
76             </member>
77             <member>
78                 <link linkend="mfprintf">mfprintf</link>
79             </member>
80             <member>
81                 <link linkend="fprintfMat">fprintfMat</link>
82             </member>
83             <member>
84                 <link linkend="mfscanf">mfscanf</link>
85             </member>
86             <member>
87                 <link linkend="fscanfMat">fscanfMat</link>
88             </member>
89             <member>
90                 <link linkend="mget">mget</link>
91             </member>
92             <member>
93                 <link linkend="mgetstr">mgetstr</link>
94             </member>
95             <member>
96                 <link linkend="mopen">mopen</link>
97             </member>
98             <member>
99                 <link linkend="mprintf">mprintf</link>
100             </member>
101             <member>
102                 <link linkend="mput">mput</link>
103             </member>
104             <member>
105                 <link linkend="mputstr">mputstr</link>
106             </member>
107             <member>
108                 <link linkend="mseek">mseek</link>
109             </member>
110             <member>
111                 <link linkend="mdelete">mdelete</link>
112             </member>
113         </simplelist>
114     </refsection>
115 </refentry>