*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="createdir">
- <refnamediv>
- <refname>createdir</refname>
- <refpurpose>makes new directory</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>createdir(dirname)
- status = createdir(dirname)
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>dirname</term>
- <listitem>
- <para>a character string.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>status</term>
- <listitem>
- <para>a boolean.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- <code>createdir(dirname)</code> creates the directory
- <varname>dirname</varname> in the current
- directory, if <varname>dirname</varname> is not in the current
- directory, specify the relative path to the current directory or the
- full path for <varname>dirname</varname>.
- </para>
- <para>
- <code>[status] = createdir(dirname)</code> creates the directory
- <varname>dirname</varname> in the existing directory, returning the
- status. Here, <varname>status</varname> is <constant>%T</constant> for
- success and <constant>%F</constant> otherwise.
- </para>
- <para><function>createdir</function> is used by <function>mkdir</function>.</para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>createdir</refname>
+ <refpurpose>makes new directory</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>createdir(dirname)
+ status = createdir(dirname)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>dirname</term>
+ <listitem>
+ <para>a character string.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>status</term>
+ <listitem>
+ <para>a boolean.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <code>createdir(dirname)</code> creates the directory
+ <varname>dirname</varname> in the current
+ directory, if <varname>dirname</varname> is not in the current
+ directory, specify the relative path to the current directory or the
+ full path for <varname>dirname</varname>.
+ </para>
+ <para>
+ <code>[status] = createdir(dirname)</code> creates the directory
+ <varname>dirname</varname> in the existing directory, returning the
+ status. Here, <varname>status</varname> is <constant>%T</constant> for
+ success and <constant>%F</constant> otherwise.
+ </para>
+ <para>
+ <function>createdir</function> is used by <function>mkdir</function>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
createdir(TMPDIR+'/Directory_test')
removedir(TMPDIR+'/Directory_test')
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mkdir">mkdir</link>
- </member>
- <member>
- <link linkend="rmdir">rmdir</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="mkdir">mkdir</link>
+ </member>
+ <member>
+ <link linkend="rmdir">rmdir</link>
+ </member>
+ <member>
+ <link linkend="removedir">removedir</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="fscanf">
- <refnamediv>
- <refname>fscanf</refname>
- <refpurpose> Converts formatted input read on a file</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>[v_1,...v_n]=fscanf (file,format)</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>format</term>
- <listitem>
- <para>Specifies the format conversion.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>file</term>
- <listitem>
- <para>Specifies the input file name or file number.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- This function is obsolete, use preferably the <literal>mfscanf</literal>
- function which is more efficient and is more compatible with the C
- <literal>fscanf</literal> procedure.
- </para>
- <para>
- The fscanf functions read character data on the file specified by the
- <literal>file</literal> argument , interpret it according
- to a format, and returns the converted results.
- </para>
- <para>
- The format parameter contains conversion specifications
- used to interpret the input.
- </para>
- <para>
- The format parameter can contain
- white-space characters (blanks, tabs, newline, or formfeed)
- that, except in the following two cases, read the input up to the
- next nonwhite-space character. Unless there is a match in the control
- string, trailing white space (including a newline character) is not
- read.
- </para>
- <itemizedlist>
- <listitem>
- <para>Any character except % (percent sign), which must match the next character of the input stream.</para>
- </listitem>
- <listitem>
+ <refnamediv>
+ <refname>fscanf</refname>
+ <refpurpose>
+ converts formatted input read on a file (<emphasis role="bold">This function is obsolete</emphasis>)
+ </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>[v_1, ..., v_n]=fscanf (file, format)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>format</term>
+ <listitem>
+ <para>
+ a character string: specifies the format conversion.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>file</term>
+ <listitem>
+ <para>
+ a character string giving the file name or an integer giving a logical unit returned by <function>mopen</function>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
<para>
- A conversion specification that directs the conversion of the next input field. see <link linkend="scanf_conversion">scanf_conversion</link> for details.
+ <warning>
+ This function is obsolete, use preferably the <function>mfscanf</function>
+ function which is more efficient and is more compatible with the C
+ <function>fscanf</function> procedure.
+ </warning>
</para>
- </listitem>
- </itemizedlist>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="printf">printf</link>
- </member>
- <member>
- <link linkend="read">read</link>
- </member>
- <member>
- <link linkend="scanf">scanf</link>
- </member>
- <member>
- <link linkend="sscanf">sscanf</link>
- </member>
- <member>
- <link linkend="mfscanf">mfscanf</link>
- </member>
- <member>
- <link linkend="scanf_conversion">scanf_conversion</link>
- </member>
- </simplelist>
- </refsection>
+ <para>
+ The <function>fscanf</function> function reads character data on the file specified by the
+ <varname>file</varname> argument, interprets it according
+ to a <varname>format</varname>, and returns the converted results.
+ </para>
+ <para>
+ The <varname>format</varname> parameter contains conversion specifications
+ used to interpret the input.
+ </para>
+ <para>
+ The <varname>format</varname> parameter can contain
+ white-space characters (blanks, tabs, newline, or formfeed)
+ that, except in the following two cases, read the input up to the
+ next nonwhite-space character. Unless there is a match in the control
+ string, trailing white space (including a newline character) is not
+ read.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Any character except <literal>%</literal> (percent sign), which must match the next character of the input stream.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ A conversion specification that directs the conversion of the next input field. See <link linkend="scanf_conversion">scanf_conversion</link> for details.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="mprintf">mprintf</link>
+ </member>
+ <member>
+ <link linkend="read">read</link>
+ </member>
+ <member>
+ <link linkend="scanf">scanf</link>
+ </member>
+ <member>
+ <link linkend="sscanf">sscanf</link>
+ </member>
+ <member>
+ <link linkend="mfscanf">mfscanf</link>
+ </member>
+ <member>
+ <link linkend="scanf_conversion">scanf_conversion</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="fscanfMat" xml:lang="en">
- <refnamediv>
- <refname>fscanfMat</refname>
- <refpurpose>reads a matrix from a text file</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>M = fscanfMat(filename[, fmt]);
- [M, text] = fscanfMat(filename [, fmt]);
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>filename</term>
- <listitem>
- <para>
- a character string giving the name of the file to be scanned.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>fmt</term>
- <listitem>
- <para>
- a character string giving the format. This is an optional
- parameter, the default value is <literal>"%lg"</literal>.
- </para>
- <para>
- Supported format: <literal>%[width].[precision]type</literal> or <literal>%type</literal> where:
- </para>
- <para>
- <literal>width</literal>: optional number that specifies
- the minimum number of characters output;
- </para>
- <para>
- <literal>precision</literal>: optional number that
- specifies the maximum number of characters printed for all
- or part of the output field, or the minimum number of
- digits printed for integer values.
- </para>
- <para>
- <literal>type</literal>: lf, lg, d, i, e, f, g (see <link
+ <refnamediv>
+ <refname>fscanfMat</refname>
+ <refpurpose>reads a matrix from a text file</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>M = fscanfMat(filename[, fmt]);
+ [M, text] = fscanfMat(filename [, fmt]);
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>filename</term>
+ <listitem>
+ <para>
+ a character string giving the name of the file to be scanned.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>fmt</term>
+ <listitem>
+ <para>
+ a character string giving the format. This is an optional
+ parameter, the default value is <literal>"%lg"</literal>.
+ </para>
+ <para>
+ Supported format: <literal>%[width].[precision]type</literal> or <literal>%type</literal> where:
+ </para>
+ <para>
+ <literal>width</literal>: optional number that specifies
+ the minimum number of characters output;
+ </para>
+ <para>
+ <literal>precision</literal>: optional number that
+ specifies the maximum number of characters printed for all
+ or part of the output field, or the minimum number of
+ digits printed for integer values.
+ </para>
+ <para>
+ <literal>type</literal>: lf, lg, d, i, e, f, g (see <link
linkend="scanf_conversion">scanf_conversion</link>).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>M</term>
- <listitem>
- <para>output variable. A matrix of real numbers.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>text</term>
- <listitem>
- <para>
- output variable. A column vector of strings. It is
- comments in the beginning of the file <literal>filename</literal>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- The <literal>fscanfMat</literal> function is used to read a real
- matrix from a text file. The first non-numeric lines of the file are
- returned in <literal>text</literal> if requested and all the remaining
- lines must have the same number of columns (column separator are assumed
- to be white spaces or tab characters). The number of columns of the matrix
- will follow the number of columns found in the file and the number of
- lines is fetched by detecting eof in the input file. This function can be
- used to read back numerical data saved with the
- <literal>fprintfMat</literal> (default separator used is a space).
- </para>
- <para>
- <literal>fscanfMat</literal> supports files encoded as ANSI/ASCII and UTF-8.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example">
- fd = mopen(TMPDIR + "/Mat", "w");
- mfprintf(fd, "Some text.....\n");
- mfprintf(fd, "Some text again\n");
- a = rand(6,6);
- for i = 1:6 ,
- for j = 1:6, mfprintf(fd, "%5.2f ", a(i,j));end;
- mfprintf(fd, "\n");
- end
- mclose(fd);
- a1 = fscanfMat(TMPDIR + "/Mat")
-
- A = ones(5,5) + 0.1;
- fprintfMat(TMPDIR + "/Matrix.txt", A, "%lg");
- B = fscanfMat(TMPDIR + "/Matrix.txt", "%lg");
- A == B
-
- C = [%nan, %inf, -%inf, 1];
- fprintfMat(TMPDIR + "/MatrixNANINF.txt", C);
- D = fscanfMat(TMPDIR + '/MatrixNANINF.txt')
-
- </programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="scanf_conversion">scanf_conversion</link>
- </member>
- <member>
- <link linkend="mclose">mclose</link>
- </member>
- <member>
- <link linkend="meof">meof</link>
- </member>
- <member>
- <link linkend="mfprintf">mfprintf</link>
- </member>
- <member>
- <link linkend="fprintfMat">fprintfMat</link>
- </member>
- <member>
- <link linkend="mfscanf">mfscanf</link>
- </member>
- <member>
- <link linkend="fscanfMat">fscanfMat</link>
- </member>
- <member>
- <link linkend="mget">mget</link>
- </member>
- <member>
- <link linkend="mgetstr">mgetstr</link>
- </member>
- <member>
- <link linkend="mopen">mopen</link>
- </member>
- <member>
- <link linkend="mprintf">mprintf</link>
- </member>
- <member>
- <link linkend="mput">mput</link>
- </member>
- <member>
- <link linkend="mputstr">mputstr</link>
- </member>
- <member>
- <link linkend="mscanf">mscanf</link>
- </member>
- <member>
- <link linkend="mseek">mseek</link>
- </member>
- <member>
- <link linkend="mtell">mtell</link>
- </member>
- <member>
- <link linkend="mdelete">mdelete</link>
- </member>
- </simplelist>
- </refsection>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M</term>
+ <listitem>
+ <para>output variable. A matrix of real numbers.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>text</term>
+ <listitem>
+ <para>
+ output variable. A column vector of strings. It is
+ comments in the beginning of the file <varname>filename</varname>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ The <function>fscanfMat</function> function is used to read a real
+ matrix from a text file. The first non-numeric lines of the file are
+ returned in <varname>text</varname> if requested and all the remaining
+ lines must have the same number of columns (column separator are assumed
+ to be white spaces or tab characters). The number of columns of the matrix
+ will follow the number of columns found in the file and the number of
+ lines is fetched by detecting eof in the input file. This function can be
+ used to read back numerical data saved with the
+ <function>fprintfMat</function> (default separator used is a space).
+ </para>
+ <para>
+ <function>fscanfMat</function> supports files encoded as ANSI/ASCII and UTF-8.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example">
+ fd = mopen(TMPDIR + "/Mat", "w");
+ mfprintf(fd, "Some text.....\n");
+ mfprintf(fd, "Some text again\n");
+ a = rand(6,6);
+ for i = 1:6 ,
+ for j = 1:6, mfprintf(fd, "%5.2f ", a(i,j));end;
+ mfprintf(fd, "\n");
+ end
+ mclose(fd);
+ a1 = fscanfMat(TMPDIR + "/Mat")
+
+ A = ones(5,5) + 0.1;
+ fprintfMat(TMPDIR + "/Matrix.txt", A, "%lg");
+ B = fscanfMat(TMPDIR + "/Matrix.txt", "%lg");
+ A == B
+
+ C = [%nan, %inf, -%inf, 1];
+ fprintfMat(TMPDIR + "/MatrixNANINF.txt", C);
+ D = fscanfMat(TMPDIR + '/MatrixNANINF.txt')
+
+ </programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="scanf_conversion">scanf_conversion</link>
+ </member>
+ <member>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="meof">meof</link>
+ </member>
+ <member>
+ <link linkend="mfprintf">mfprintf</link>
+ </member>
+ <member>
+ <link linkend="fprintfMat">fprintfMat</link>
+ </member>
+ <member>
+ <link linkend="mfscanf">mfscanf</link>
+ </member>
+ <member>
+ <link linkend="fscanfMat">fscanfMat</link>
+ </member>
+ <member>
+ <link linkend="mget">mget</link>
+ </member>
+ <member>
+ <link linkend="mgetstr">mgetstr</link>
+ </member>
+ <member>
+ <link linkend="mopen">mopen</link>
+ </member>
+ <member>
+ <link linkend="mprintf">mprintf</link>
+ </member>
+ <member>
+ <link linkend="mput">mput</link>
+ </member>
+ <member>
+ <link linkend="mputstr">mputstr</link>
+ </member>
+ <member>
+ <link linkend="mscanf">mscanf</link>
+ </member>
+ <member>
+ <link linkend="mseek">mseek</link>
+ </member>
+ <member>
+ <link linkend="mtell">mtell</link>
+ </member>
+ <member>
+ <link linkend="mdelete">mdelete</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="ls">
- <refnamediv>
- <refname>ls</refname>
- <refpurpose>shows files</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>
- files=ls [path]
- files=ls( [path] )
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>path</term>
- <listitem>
- <para>
- a string matrix giving a directory pathname (eventually ended
- by a pattern built with <literal>*</literal>). Default value is <literal>.</literal> (a dot).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>files</term>
- <listitem>
- <para>
- a string column vector. By default it contains a column
- formatted output.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- <function>ls</function> can be used to list the files which match
- the patterns given by the path argument.
- Patterns are given to the Unix <command>ls</command> or to the Windows
- <command>dir</command> commands in order to get information on files.
- Thus in order to write portable Scilab script valid wildcard patterns
- for both OS are to be given. Note that pathname conversion is
- performed and for example <literal>SCI/modules/core/macros/*.sci</literal> is a valid
- pattern for both Unix and Windows.
- </para>
- <para>
- If you want to get a vector of all files matching a pattern use preferabily
- the <link linkend="listfiles">listfiles</link> or the <link linkend="dir">dir</link> function.
- </para>
- <para>
- <note>
- Please note that starting from the version 5.0 of Scilab, the second
- input argument has been removed (a sequence of strings which can
- be added under Unix systems: the Unix <command>ls</command> command
- options). This option has been removed mainly for security and portability reasons.
- </note>
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>ls</refname>
+ <refpurpose>shows files</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>
+ files=ls [path]
+ files=ls( [path] )
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>path</term>
+ <listitem>
+ <para>
+ a string matrix giving a directory pathname (eventually ended
+ by a pattern built with <literal>*</literal>). Default value is <literal>.</literal> (a dot).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>files</term>
+ <listitem>
+ <para>
+ a string column vector. By default it contains a column
+ formatted output.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <function>ls</function> can be used to list the files which match
+ the patterns given by the <varname>path</varname> argument.
+ Patterns are given to the Unix <command>ls</command> or to the Windows
+ <command>dir</command> commands in order to get information on files.
+ Thus in order to write portable Scilab script valid wildcard patterns
+ for both OS are to be given. Note that pathname conversion is
+ performed and for example <literal>SCI/modules/core/macros/*.sci</literal> is a valid
+ pattern for both Unix and Windows.
+ </para>
+ <para>
+ If you want to get a vector of all files matching a pattern use preferabily
+ the <link linkend="listfiles">listfiles</link> or the <link linkend="dir">dir</link> function.
+ </para>
+ <para>
+ <note>
+ Please note that starting from the version 5.0 of Scilab, the second
+ input argument has been removed (a sequence of strings which can
+ be added under Unix systems: the Unix <command>ls</command> command
+ options). This option has been removed mainly for security and portability reasons.
+ </note>
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
ls
ls SCI/modules/core/macros/*.sci
x=ls('SCI/modules/core/macros/*.sci')
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="listfiles">listfiles</link>
- </member>
- <member>
- <link linkend="findfiles">findfiles</link>
- </member>
- <member>
- <link linkend="dir">dir</link>
- </member>
- <member>
- <link linkend="fileinfo">fileinfo</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="listfiles">listfiles</link>
+ </member>
+ <member>
+ <link linkend="findfiles">findfiles</link>
+ </member>
+ <member>
+ <link linkend="dir">dir</link>
+ </member>
+ <member>
+ <link linkend="fileinfo">fileinfo</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="mget" xml:lang="en">
- <refnamediv>
- <refname>mget</refname>
- <refpurpose>reads byte or word in a given binary format and converts to
- a double type
- </refpurpose>
- </refnamediv>
- <refnamediv xml:id="mgeti">
- <refname>mgeti</refname>
- <refpurpose>
- reads byte or word in a given binary format and returns an int type
- </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>
- x = mget([n, type, fd])
- x = mgeti([n, type, fd])
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>n</term>
- <listitem>
- <para>a positive scalar: the number of items to be read.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>fd</term>
- <listitem>
- <para>
- a scalar: the <varname>fd</varname> parameter returned by the
- function <function>mopen</function>. -1 stands for the last
- opened file. Default value is -1.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>type</term>
- <listitem>
- <para>
- a string: the binary format used to write all the entries of
- <varname>x</varname>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>x</term>
- <listitem>
- <para>a vector of floating point or integer numbers.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- The <function>mget</function> function reads data in the input
- specified by the stream parameter <varname>fd</varname> and returns a
- vector of floating point data.
- </para>
-
- <para>
- The <function>mgeti</function> function reads data in the input
- specified by the stream parameter <varname>fd</varname> and returns a
- vector of integer data.
- </para>
- <para>
- Data is read at the position at which the file pointer is currently
- pointing and advances the indicator appropriately.
- </para>
- <para>
- The <varname>type</varname> parameter is a conversion specifier
- which may be set to any of the following flag characters (with default
- value <literal>"l"</literal>):
- </para>
- <para>
- <note>
- On Windows, default behavior is to skip byte 13 (0x0D).
- <function>mopen</function> should be called with the
- <literal>'b'</literal> option, e.g.
- <code>fd1=mopen(file1,'rb')</code>, so that all bytes will be read
- without exception.
- </note>
- </para>
- <para>Data type:</para>
- <variablelist>
- <varlistentry>
- <term>d</term>
- <listitem>
- <para>double</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>f</term>
- <listitem>
- <para>float</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>l</term>
- <listitem>
- <para>long</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>i</term>
- <listitem>
- <para>int</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>s</term>
- <listitem>
- <para>short</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>c</term>
- <listitem>
- <para>character</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>Optional flag:</para>
- <variablelist>
- <varlistentry>
- <term>u..</term>
- <listitem>
- <para>unsigned (in combination with one of the above types)</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>..l</term>
- <listitem>
- <para>
- little endian (in combination with one of the above types)
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>..b</term>
- <listitem>
- <para>
- big endian (in combination with one of the above types)
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>
- Bytes read is automatically swapped if necessary (by checking
- <literal>little=endian</literal> status).
- </para>
- <para>
- This default swapping behavior can be suprressed by adding a flag in
- the <function>mopen</function> function.
- </para>
- <para>
- Formats <literal>"l"</literal>, <literal>"d"</literal> and
- <literal>"f"</literal> are only valid with the
- <function>mget</function> function.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>mget</refname>
+ <refpurpose>reads byte or word in a given binary format and converts to
+ a double type
+ </refpurpose>
+ </refnamediv>
+ <refnamediv xml:id="mgeti">
+ <refname>mgeti</refname>
+ <refpurpose>
+ reads byte or word in a given binary format and returns an int type
+ </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>
+ x = mget([n, type, fd])
+ x = mgeti([n, type, fd])
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>n</term>
+ <listitem>
+ <para>a positive scalar: the number of items to be read.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>fd</term>
+ <listitem>
+ <para>
+ a scalar: a file descriptor returned by the function <function>mopen</function>. <literal>-1</literal>
+ stands for last opened file. Default value is
+ <literal>-1</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>type</term>
+ <listitem>
+ <para>
+ a string: the binary format used to write all the entries of
+ <varname>x</varname>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x</term>
+ <listitem>
+ <para>a vector of floating point or integer numbers.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ The <function>mget</function> function reads data in the input
+ specified by the stream parameter <varname>fd</varname> and returns a
+ vector of floating point data.
+ </para>
+
+ <para>
+ The <function>mgeti</function> function reads data in the input
+ specified by the stream parameter <varname>fd</varname> and returns a
+ vector of integer data.
+ </para>
+ <para>
+ Data is read at the position at which the file pointer is currently
+ pointing and advances the indicator appropriately.
+ </para>
+ <para>
+ The <varname>type</varname> parameter is a conversion specifier
+ which may be set to any of the following flag characters (with default
+ value <literal>"l"</literal>):
+ </para>
+ <para>
+ <note>
+ On Windows, default behavior is to skip byte 13 (0x0D).
+ <function>mopen</function> should be called with the
+ <literal>'b'</literal> option, e.g.
+ <code>fd1=mopen(file1,'rb')</code>, so that all bytes will be read
+ without exception.
+ </note>
+ </para>
+ <para>Data type:</para>
+ <variablelist>
+ <varlistentry>
+ <term>d</term>
+ <listitem>
+ <para>double</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>f</term>
+ <listitem>
+ <para>float</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>l</term>
+ <listitem>
+ <para>long</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>i</term>
+ <listitem>
+ <para>int</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>s</term>
+ <listitem>
+ <para>short</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>c</term>
+ <listitem>
+ <para>character</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>Optional flag:</para>
+ <variablelist>
+ <varlistentry>
+ <term>u..</term>
+ <listitem>
+ <para>unsigned (in combination with one of the above types)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>..l</term>
+ <listitem>
+ <para>
+ little endian (in combination with one of the above types)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>..b</term>
+ <listitem>
+ <para>
+ big endian (in combination with one of the above types)
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ Bytes read is automatically swapped if necessary (by checking
+ <literal>little=endian</literal> status).
+ </para>
+ <para>
+ This default swapping behavior can be suprressed by adding a flag in
+ the <function>mopen</function> function.
+ </para>
+ <para>
+ Formats <literal>"l"</literal>, <literal>"d"</literal> and
+ <literal>"f"</literal> are only valid with the
+ <function>mget</function> function.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
file1 = fullfile(TMPDIR,'test1.bin');
file2 = fullfile(TMPDIR,'test2.bin');
fd1=mopen(file1,'wb');
mclose(fd1);
mclose(fd2);
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mclose">mclose</link>
- </member>
- <member>
- <link linkend="meof">meof</link>
- </member>
- <member>
- <link linkend="mfprintf">mfprintf</link>
- </member>
- <member>
- <link linkend="fprintfMat">fprintfMat</link>
- </member>
- <member>
- <link linkend="mfscanf">mfscanf</link>
- </member>
- <member>
- <link linkend="fscanfMat">fscanfMat</link>
- </member>
- <member>
- <link linkend="mgetl">mgetl</link>
- </member>
- <member>
- <link linkend="mgetstr">mgetstr</link>
- </member>
- <member>
- <link linkend="mopen">mopen</link>
- </member>
- <member>
- <link linkend="mprintf">mprintf</link>
- </member>
- <member>
- <link linkend="mput">mput</link>
- </member>
- <member>
- <link linkend="mputl">mputl</link>
- </member>
- <member>
- <link linkend="mputstr">mputstr</link>
- </member>
- <member>
- <link linkend="mseek">mseek</link>
- </member>
- <member>
- <link linkend="mtell">mtell</link>
- </member>
- <member>
- <link linkend="mdelete">mdelete</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="meof">meof</link>
+ </member>
+ <member>
+ <link linkend="mfprintf">mfprintf</link>
+ </member>
+ <member>
+ <link linkend="fprintfMat">fprintfMat</link>
+ </member>
+ <member>
+ <link linkend="mfscanf">mfscanf</link>
+ </member>
+ <member>
+ <link linkend="fscanfMat">fscanfMat</link>
+ </member>
+ <member>
+ <link linkend="mgetl">mgetl</link>
+ </member>
+ <member>
+ <link linkend="mgetstr">mgetstr</link>
+ </member>
+ <member>
+ <link linkend="mopen">mopen</link>
+ </member>
+ <member>
+ <link linkend="mprintf">mprintf</link>
+ </member>
+ <member>
+ <link linkend="mput">mput</link>
+ </member>
+ <member>
+ <link linkend="mputl">mputl</link>
+ </member>
+ <member>
+ <link linkend="mputstr">mputstr</link>
+ </member>
+ <member>
+ <link linkend="mseek">mseek</link>
+ </member>
+ <member>
+ <link linkend="mtell">mtell</link>
+ </member>
+ <member>
+ <link linkend="mdelete">mdelete</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="mgetl">
- <refnamediv>
- <refname>mgetl</refname>
- <refpurpose>reads lines from an text file</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>txt = mgetl(file_desc [,m])</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>file_desc</term>
- <listitem>
- <para>
- a character string giving the file name or a logical unit
- returned by <function>mopen</function>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>m</term>
- <listitem>
- <para>
- an integer scalar: a number of lines to read. Default value is -1.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>txt</term>
- <listitem>
- <para>a column vector of strings.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- <function>mgetl</function> function allows to read a lines from an text file.
- </para>
- <para>
- If <varname>m</varname> is omitted or is <literal>-1</literal> all lines till end of file occurs are read.
- </para>
- <para>
- If <varname>m</varname> is given <function>mgetl</function> tries to
- read exactly <varname>m</varname> lines. This option is useful to
- sequentialy read part of a file. In this case if an end of file (EOF)
- occurs before <varname>m</varname> lines are read the read lines are
- returned (it is possible to check if EOF had occurred using the
- <function>meof</function> function) issued.
- </para>
- <para>
- <function>mgetl</function> allows to read files coming from Unix,
- Windows or Mac operating systems.
- </para>
- <para>
- <function>mgetl</function> supports only UTF-8 and ANSI file encoding.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>mgetl</refname>
+ <refpurpose>reads lines from an text file</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>txt = mgetl(file_desc [,m])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>file_desc</term>
+ <listitem>
+ <para>
+ a character string giving the file name or an integer giving a logical unit returned by <function>mopen</function>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>m</term>
+ <listitem>
+ <para>
+ an integer scalar: a number of lines to read. Default value is -1.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>txt</term>
+ <listitem>
+ <para>a column vector of strings.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <function>mgetl</function> function allows to read a lines from an text file.
+ </para>
+ <para>
+ If <varname>m</varname> is omitted or is <literal>-1</literal> all lines till end of file occurs are read.
+ </para>
+ <para>
+ If <varname>m</varname> is given <function>mgetl</function> tries to
+ read exactly <varname>m</varname> lines. This option is useful to
+ sequentialy read part of a file. In this case if an end of file (EOF)
+ occurs before <varname>m</varname> lines are read the read lines are
+ returned (it is possible to check if EOF had occurred using the
+ <function>meof</function> function) issued.
+ </para>
+ <para>
+ <function>mgetl</function> allows to read files coming from Unix,
+ Windows or Mac operating systems.
+ </para>
+ <para>
+ <function>mgetl</function> supports only UTF-8 and ANSI file encoding.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
mgetl('SCI/etc/scilab.start',5)
mgetl SCI/modules/elementary_functions/macros/erf.sci
mgetl(fd,10)
mclose(fd)
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mputl">mputl</link>
- </member>
- <member>
- <link linkend="mclose">mclose</link>
- </member>
- <member>
- <link linkend="mfscanf">mfscanf</link>
- </member>
- <member>
- <link linkend="mget">mget</link>
- </member>
- <member>
- <link linkend="mput">mput</link>
- </member>
- <member>
- <link linkend="mgetstr">mgetstr</link>
- </member>
- <member>
- <link linkend="mopen">mopen</link>
- </member>
- <member>
- <link linkend="read">read</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="mputl">mputl</link>
+ </member>
+ <member>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="mfscanf">mfscanf</link>
+ </member>
+ <member>
+ <link linkend="mget">mget</link>
+ </member>
+ <member>
+ <link linkend="mput">mput</link>
+ </member>
+ <member>
+ <link linkend="mgetstr">mgetstr</link>
+ </member>
+ <member>
+ <link linkend="mopen">mopen</link>
+ </member>
+ <member>
+ <link linkend="read">read</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="mopen" xml:lang="en">
- <refnamediv>
- <refname>mopen</refname>
- <refpurpose>open a file in Scilab</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>[fd, err] = mopen(file [, mode, swap ])</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>file</term>
- <listitem>
- <para>a character string. The pathname of the file to open.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>mode</term>
- <listitem>
- <para>a character string that controls whether the file is opened
- for reading (r), writing (w), or appending (a) and whether the file
- is opened for updating (+). The mode can also include a b parameter
- to indicate a binary file.
- </para>
- <para>'rb' default value</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>swap</term>
- <listitem>
- <para>
- a scalar. If <literal>swap</literal> is present and
- <literal>swap = 0</literal> then automatic bytes swap is
- disabled.
- </para>
- <para>1 default value</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>err</term>
- <listitem>
- <para>a scalar. Error indicator.</para>
- <informaltable border="1">
- <tr>
- <td>error value:</td>
- <td>error message:</td>
- </tr>
- <tr>
- <td>0</td>
- <td>No error</td>
- </tr>
- <tr>
- <td>-1</td>
- <td>no more logical units</td>
- </tr>
- <tr>
- <td>-2</td>
- <td>cannot open file</td>
- </tr>
- <tr>
- <td>-3</td>
- <td>no more memory</td>
- </tr>
- <tr>
- <td>-4</td>
- <td>invalid name</td>
- </tr>
- <tr>
- <td>-5</td>
- <td>invalid status</td>
- </tr>
- </informaltable>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>fd</term>
- <listitem>
- <para>
- scalar. The <literal>fd</literal> parameter returned by the
- function <literal>mopen</literal> is used as a file descriptor (it's
- a positive integer).
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- <literal>mopen</literal> may be used to open a file in a way
- compatible with the C <literal>fopen</literal> procedure. Without swap
- argument the file is supposed to be coded in "little endian IEEE format"
- and data are swaped if necessary to match the IEEE format of the
- processor.
- </para>
- <para>The mode parameter controls the access allowed to the stream. The
- parameter can have one of the following values. In this list of values,
- the b character indicates a binary file
- </para>
- <variablelist>
- <varlistentry>
- <term>r</term>
- <listitem>
- <para>Opens the file for reading.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>rb</term>
- <listitem>
- <para>Opens a binary file for reading.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>rt</term>
- <listitem>
- <para>Opens a text file for reading.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>w</term>
- <listitem>
- <para>Creates a new file for writing, or opens and truncates a file
- to zero length.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>wb</term>
- <listitem>
- <para>Creates a new binary file for writing, or opens and truncates
- a file to zero length.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>wt</term>
- <listitem>
- <para>Creates a text binary file for writing, or opens and truncates
- a file to zero length.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>a or ab</term>
- <listitem>
- <para>Appends (opens a file for writing at the end of the file, or
- creates a file for writing).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>r+ or r+b</term>
- <listitem>
- <para>Opens a file for update (reading and writing).</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>w+ or w+b</term>
- <listitem>
- <para>Truncates to zero length or creates a file for update.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>a+ or a+b</term>
- <listitem>
- <para>Appends (opens a file for update, writing at the end of the
- file, or creates a file for writing).
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>When you open a file for update, you can perform both input and
- output operations on the resulting stream. However, an output operation
- cannot be directly followed by an input operation without a
- file-positioning operation (mseek() function). Also, an input operation
- cannot be directly followed by an output operation without an intervening
- file positioning operation, unless the input operation encounters the end
- of the file.
- </para>
- <para>When you open a file for append (that is, when the mode parameter is
- a or a+), it is impossible to overwrite information already in the file.
- You can use the fseek() function to reposition the file pointer to any
- position in the file, but when output is written to the file, the current
- file pointer is ignored. All output is written at the end of the file and
- the file pointer is repositioned to the end of the output.
- </para>
- <para>To open files in a way compatible with Fortran like functions use
- function <literal>file</literal>.
- </para>
- </refsection>
- <refsection>
- </refsection>
- <refsection>
- <programlisting role="example">// open a SCI+'/ACKNOWLEDGEMENTS' as text and read only
- fd_r = mopen(SCI+'/ACKNOWLEDGEMENTS', 'rt')
-
- // read five lines of fd_r
- mgetl(fd_r, 5)
-
- // another way to read file
- // here read five words
- mfscanf(5, fd_r, '%s')
-
- // close file descriptor associated to SCI+'/ACKNOWLEDGEMENTS' as text and read only
- mclose(fd_r);
- </programlisting>
- </refsection>
- <refsection>
- </refsection>
- <refsection>
- <programlisting role="example">// open a file as text with write property
- fd_w = mopen(TMPDIR+'/write.txt', 'wt');
-
- // write a line in fd_w
- mputl('This is a line of text', fd_w);
- mclose(fd_w);
-
- // read text
- fd_r2 = mopen(TMPDIR+'/write.txt', 'rt');
- mgetl(fd_r2)
- mclose(fd_r2);
- </programlisting>
- </refsection>
- <refsection>
- </refsection>
- <refsection>
- <programlisting role="example">// read write a file as binary
-
- // first we write file
- fd_wb = mopen(TMPDIR+'/writeread.bin', 'wb')
-
- // put values as binary
- mput(2003, 'l', fd_wb);
- mput(2008, 'i', fd_wb);
- mput(2012, 's', fd_wb);
- mput(98, 'c', fd_wb);
-
- // close file descriptor associated to TMPDIR+'/writeread.bin'
- mclose(fd_wb);
-
- // we read file
- fd_rb = mopen(TMPDIR+'/writeread.bin', 'rb')
-
- mget(fd_rb, 'l')
- mget(fd_rb, 'i')
- mget(fd_rb, 's')
- mget(fd_rb, 'c')
-
- mclose(fd_rb)
- </programlisting>
- </refsection>
- <refsection>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mclose">mclose</link>
- </member>
- <member>
- <link linkend="merror">merror</link>
- </member>
- <member>
- <link linkend="meof">meof</link>
- </member>
- <member>
- <link linkend="mfprintf">mfprintf</link>
- </member>
- <member>
- <link linkend="fprintfMat">fprintfMat</link>
- </member>
- <member>
- <link linkend="mfscanf">mfscanf</link>
- </member>
- <member>
- <link linkend="fscanfMat">fscanfMat</link>
- </member>
- <member>
- <link linkend="mget">mget</link>
- </member>
- <member>
- <link linkend="mgetl">mgetl</link>
- </member>
- <member>
- <link linkend="mgetstr">mgetstr</link>
- </member>
- <member>
- <link linkend="mprintf">mprintf</link>
- </member>
- <member>
- <link linkend="mput">mput</link>
- </member>
- <member>
- <link linkend="mputl">mputl</link>
- </member>
- <member>
- <link linkend="mputstr">mputstr</link>
- </member>
- <member>
- <link linkend="mscanf">mscanf</link>
- </member>
- <member>
- <link linkend="mseek">mseek</link>
- </member>
- <member>
- <link linkend="mtell">mtell</link>
- </member>
- <member>
- <link linkend="mdelete">mdelete</link>
- </member>
- </simplelist>
- </refsection>
+ <refnamediv>
+ <refname>mopen</refname>
+ <refpurpose>opens a file in Scilab</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>[fd, err] = mopen(file [, mode, swap ])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>file</term>
+ <listitem>
+ <para>a character string. The pathname of the file to open.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mode</term>
+ <listitem>
+ <para>
+ a character string that controls whether the file is opened for
+ reading (<literal>r</literal>), writing (<literal>w</literal>),
+ or appending (<literal>a</literal>) and whether the file is
+ opened for updating (<literal>+</literal>). The
+ <varname>mode</varname> can also include a <literal>b</literal>
+ parameter to indicate a binary file.
+ </para>
+ <para>
+ The default value is <literal>'rb'</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>swap</term>
+ <listitem>
+ <para>
+ a scalar. If <varname>swap</varname> is present and
+ <code>swap = 0</code> then automatic bytes swap is
+ disabled.
+ </para>
+ <para>The default value is 1.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>err</term>
+ <listitem>
+ <para>a scalar. Error indicator.</para>
+ <informaltable border="1">
+ <tr>
+ <td>error value:</td>
+ <td>error message:</td>
+ </tr>
+ <tr>
+ <td>0</td>
+ <td>No error</td>
+ </tr>
+ <tr>
+ <td>-1</td>
+ <td>no more logical units</td>
+ </tr>
+ <tr>
+ <td>-2</td>
+ <td>cannot open file</td>
+ </tr>
+ <tr>
+ <td>-3</td>
+ <td>no more memory</td>
+ </tr>
+ <tr>
+ <td>-4</td>
+ <td>invalid name</td>
+ </tr>
+ <tr>
+ <td>-5</td>
+ <td>invalid status</td>
+ </tr>
+ </informaltable>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>fd</term>
+ <listitem>
+ <para>
+ a scalar: a file descriptor (it's a positive integer).
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <function>mopen</function> may be used to open a <varname>file</varname> in a way
+ compatible with the C <function>fopen</function> procedure. Without
+ <varname>swap</varname> argument the <varname>file</varname> is supposed to be coded in "little endian IEEE
+ format" and data are swaped if necessary to match the IEEE format of
+ the processor.
+ </para>
+ <para>
+ The <varname>mode</varname> parameter controls the access allowed to
+ the stream. The parameter can have one of the following values. In this
+ list of values, the <literal>b</literal> character indicates a binary
+ file.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>r</term>
+ <listitem>
+ <para>opens the file for reading.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rb</term>
+ <listitem>
+ <para>opens a binary file for reading.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rt</term>
+ <listitem>
+ <para>opens a text file for reading.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>w</term>
+ <listitem>
+ <para>
+ creates a new file for writing, or opens and truncates a file
+ to zero length.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>wb</term>
+ <listitem>
+ <para>
+ creates a new binary file for writing, or opens and truncates
+ a file to zero length.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>wt</term>
+ <listitem>
+ <para>
+ creates a text binary file for writing, or opens and truncates
+ a file to zero length.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>a or ab</term>
+ <listitem>
+ <para>
+ appends (opens a file for writing at the end of the file, or
+ creates a file for writing).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>r+ or r+b</term>
+ <listitem>
+ <para>opens a file for update (reading and writing).</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>w+ or w+b</term>
+ <listitem>
+ <para>truncates to zero length or creates a file for update.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>a+ or a+b</term>
+ <listitem>
+ <para>
+ appends (opens a file for update, writing at the end of the
+ file, or creates a file for writing).
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ When you open a file for update, you can perform both input and output
+ operations on the resulting stream. However, an output operation cannot
+ be directly followed by an input operation without a file-positioning
+ operation (<function>mseek</function> function). Also, an input
+ operation cannot be directly followed by an output operation without an
+ intervening file positioning operation, unless the input operation
+ encounters the end of the file.
+ </para>
+ <para>
+ When you open a file for append (that is, when the
+ <varname>mode</varname> parameter is <literal>a</literal> or
+ <literal>a+</literal>), it is impossible to overwrite information
+ already in the file. You can use the <function>mseek</function>
+ function to reposition the file pointer to any position in the file,
+ but when output is written to the file, the current file pointer is
+ ignored. All output is written at the end of the file and the file
+ pointer is repositioned to the end of the output.
+ </para>
+ <para>
+ To open files in a way compatible with Fortran-like functions use function <function>file</function>.
+ </para>
+ </refsection>
+ <refsection>
+ </refsection>
+ <refsection>
+ <programlisting role="example"><![CDATA[
+// open a SCI+'/ACKNOWLEDGEMENTS' as text and read only
+fd_r = mopen(SCI+'/ACKNOWLEDGEMENTS', 'rt')
+
+// read five lines of fd_r
+mgetl(fd_r, 5)
+
+// another way to read file
+// here read five words
+mfscanf(5, fd_r, '%s')
+
+// close file descriptor associated to SCI+'/ACKNOWLEDGEMENTS' as text and read only
+mclose(fd_r);
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ </refsection>
+ <refsection>
+ <programlisting role="example"><![CDATA[
+// open a file as text with write property
+fd_w = mopen(TMPDIR+'/write.txt', 'wt');
+
+// write a line in fd_w
+mputl('This is a line of text', fd_w);
+mclose(fd_w);
+
+// read text
+fd_r2 = mopen(TMPDIR+'/write.txt', 'rt');
+mgetl(fd_r2)
+mclose(fd_r2);
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ </refsection>
+ <refsection>
+ <programlisting role="example"><![CDATA[
+// read/write a file as binary
+
+// first we write file
+fd_wb = mopen(TMPDIR+'/writeread.bin', 'wb')
+
+// put values as binary
+mput(2003, 'l', fd_wb);
+mput(2008, 'i', fd_wb);
+mput(2012, 's', fd_wb);
+mput(98, 'c', fd_wb);
+
+// close file descriptor associated to TMPDIR+'/writeread.bin'
+mclose(fd_wb);
+
+// we read file
+fd_rb = mopen(TMPDIR+'/writeread.bin', 'rb')
+
+mget(fd_rb, 'l')
+mget(fd_rb, 'i')
+mget(fd_rb, 's')
+mget(fd_rb, 'c')
+
+mclose(fd_rb)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="file">file</link>
+ </member>
+ <member>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="merror">merror</link>
+ </member>
+ <member>
+ <link linkend="meof">meof</link>
+ </member>
+ <member>
+ <link linkend="mfprintf">mfprintf</link>
+ </member>
+ <member>
+ <link linkend="fprintfMat">fprintfMat</link>
+ </member>
+ <member>
+ <link linkend="mfscanf">mfscanf</link>
+ </member>
+ <member>
+ <link linkend="fscanfMat">fscanfMat</link>
+ </member>
+ <member>
+ <link linkend="mget">mget</link>
+ </member>
+ <member>
+ <link linkend="mgetl">mgetl</link>
+ </member>
+ <member>
+ <link linkend="mgetstr">mgetstr</link>
+ </member>
+ <member>
+ <link linkend="mprintf">mprintf</link>
+ </member>
+ <member>
+ <link linkend="mput">mput</link>
+ </member>
+ <member>
+ <link linkend="mputl">mputl</link>
+ </member>
+ <member>
+ <link linkend="mputstr">mputstr</link>
+ </member>
+ <member>
+ <link linkend="mseek">mseek</link>
+ </member>
+ <member>
+ <link linkend="mtell">mtell</link>
+ </member>
+ <member>
+ <link linkend="mdelete">mdelete</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="movefile" xml:lang="en">
- <refnamediv>
- <refname>movefile</refname>
- <refpurpose>Move file or directory</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>movefile('source','destination')
- [status,message] = movefile('source','destination')
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Description</title>
- <para>movefile('source','destination') moves the file or directory ,
- source (and subdirectories) to the file or directory, destination.
- </para>
- <para>If source is a directory, destination can not be a file. movefile
- replaces existing files without warning.
- </para>
- <para>[status, message] = movefile('source','destination') moves source
- to destination, returning the status and a message.
- </para>
- <para>Whatever the operating system, if the move succeeds, the status is 1
- and the message is empty ; if the move fails, the status is 0 and the
- message is not empty.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example">
+ <refnamediv>
+ <refname>movefile</refname>
+ <refpurpose>moves file or directory</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>movefile(source,destination)
+ [status,message] = movefile(source,destination)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>source</term>
+ <listitem>
+ <para>
+ a character string.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>destination</term>
+ <listitem>
+ <para>
+ a character string.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>status</term>
+ <listitem>
+ <para>
+ an integer: the status of the operation.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>message</term>
+ <listitem>
+ <para>
+ a character string: a message about an error.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+
+ <refsection>
+ <title>Description</title>
+ <para>
+ <code>movefile(source, destination)</code> moves the file or directory
+ <varname>source</varname> (and subdirectories) to the file or directory
+ <varname>destination</varname>.
+ </para>
+ <para>
+ If <varname>source</varname> is a directory, <varname>destination</varname> cannot be a file.
+ <warning>
+ <function>movefile</function> replaces existing files without
+ warning.
+ </warning>
+ </para>
+ <para>
+ <code>[status, message] = movefile(source, destination)</code> moves <varname>source</varname> to <varname>destination</varname>, returning the <varname>status</varname> and a <varname>message</varname>.
+ </para>
+ <para>
+ Whatever the operating system, if the move succeeds, the
+ <varname>status</varname> is 1 and the <varname>message</varname> is
+ empty; if the move fails, the <varname>status</varname> is 0 and the
+ <varname>message</varname> is not empty.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
copyfile(SCI+"/etc/scilab.start",TMPDIR+"/scilab.start")
[status,message] = movefile(TMPDIR+"/scilab.start",TMPDIR+"/renamed_scilab.start")
- </programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="copyfile">copyfile</link>
- </member>
- </simplelist>
- </refsection>
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="copyfile">copyfile</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="mput">
- <refnamediv>
- <refname>mput</refname>
- <refpurpose> writes byte or word in a given binary format</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>mput(x [,type,fd])</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>x</term>
- <listitem>
- <para>a vector of floating point or integer type numbers</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>fd</term>
- <listitem>
- <para>
- scalar. The <literal>fd</literal> parameter returned by the function. Default value is -1 which stands for the last (<literal>mopen</literal>) opened file.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>type</term>
- <listitem>
- <para>a string. Give the binary format used to write all the entries of x.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- The <literal>mput</literal> function writes data to the output specified by the
- stream parameter <literal>fd</literal>. Data is written at the
- position at which the file pointer is currently pointing and
- advances the indicator appropriately.
- </para>
- <para>
- The <literal>type</literal> parameter is a conversion specifier which may be set to any of the
- following flag characters (with default value "l"):
- </para>
- <variablelist>
- <varlistentry>
- <term>"l","i","s","ul","ui","us","d","f","c","uc"</term>
- <listitem>
- <para>
- for writing respectively a long, an int, a short, an unsigned long, an unsigned int, an unsigned short, a double, a float, a char and an unsigned char. The bytes which are wrote are automatically swapped if necessary (by checking little-endian status) in order to produce machine independent binary files ( in little-endian mode). This default swapping mode can be suppressed by adding a flag in the <literal>mopen</literal> function.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>"..l" or "..b"</term>
- <listitem>
- <para>It is also possible to write in little-endian or big-endian mode by adding a 'l' or 'b' character at the end of a type specification. For example "db" will write a double in big-endian mode.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>mput</refname>
+ <refpurpose> writes byte or word in a given binary format</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>mput(x [, type, fd])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>x</term>
+ <listitem>
+ <para>a vector of floating point or integer type numbers</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>fd</term>
+ <listitem>
+ <para>
+ a scalar: a file descriptor returned by the function <function>mopen</function>. <literal>-1</literal>
+ stands for last opened file. Default value is
+ <literal>-1</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>type</term>
+ <listitem>
+ <para>
+ a string: the binary format used to write all the entries of <varname>x</varname>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ The <function>mput</function> function writes data to the output specified by the
+ stream parameter <varname>fd</varname>. Data is written at the
+ position at which the file pointer is currently pointing and
+ advances the indicator appropriately.
+ </para>
+ <para>
+ The <varname>type</varname> parameter is a conversion specifier which may be set to any of the
+ following flag characters (with default value <literal>"l"</literal>):
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>"l","i","s","ul","ui","us","d","f","c","uc"</term>
+ <listitem>
+ <para>
+ for writing respectively a long, an int, a short, an unsigned long, an unsigned int, an unsigned short, a double, a float, a char and an unsigned char. The bytes which are wrote are automatically swapped if necessary (by checking little-endian status) in order to produce machine independent binary files (in little-endian mode). This default swapping mode can be suppressed by adding a flag <code>swap = 0</code> in the <function>mopen</function> function.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>"..l" or "..b"</term>
+ <listitem>
+ <para>
+ It is also possible to write in little-endian or big-endian
+ mode by adding a <literal>"l"</literal> or
+ <literal>"b"</literal> character at the end of a
+ <varname>type</varname> specification. For example
+ <literal>"db"</literal> will write a double in big-endian mode.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
filen = 'test.bin';
mopen(filen,'wb');
mput(1996,'l');mput(1996,'i');mput(1996,'s');mput(98,'c');
mclose();
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mclose">mclose</link>
- </member>
- <member>
- <link linkend="meof">meof</link>
- </member>
- <member>
- <link linkend="mfprintf">mfprintf</link>
- </member>
- <member>
- <link linkend="fprintfMat">fprintfMat</link>
- </member>
- <member>
- <link linkend="mfscanf">mfscanf</link>
- </member>
- <member>
- <link linkend="fscanfMat">fscanfMat</link>
- </member>
- <member>
- <link linkend="mget">mget</link>
- </member>
- <member>
- <link linkend="mgetl">mgetl</link>
- </member>
- <member>
- <link linkend="mgetstr">mgetstr</link>
- </member>
- <member>
- <link linkend="mopen">mopen</link>
- </member>
- <member>
- <link linkend="mprintf">mprintf</link>
- </member>
- <member>
- <link linkend="mputl">mputl</link>
- </member>
- <member>
- <link linkend="mputstr">mputstr</link>
- </member>
- <member>
- <link linkend="mscanf">mscanf</link>
- </member>
- <member>
- <link linkend="mseek">mseek</link>
- </member>
- <member>
- <link linkend="mtell">mtell</link>
- </member>
- <member>
- <link linkend="mdelete">mdelete</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="meof">meof</link>
+ </member>
+ <member>
+ <link linkend="mfprintf">mfprintf</link>
+ </member>
+ <member>
+ <link linkend="fprintfMat">fprintfMat</link>
+ </member>
+ <member>
+ <link linkend="mfscanf">mfscanf</link>
+ </member>
+ <member>
+ <link linkend="fscanfMat">fscanfMat</link>
+ </member>
+ <member>
+ <link linkend="mget">mget</link>
+ </member>
+ <member>
+ <link linkend="mgetl">mgetl</link>
+ </member>
+ <member>
+ <link linkend="mgetstr">mgetstr</link>
+ </member>
+ <member>
+ <link linkend="mopen">mopen</link>
+ </member>
+ <member>
+ <link linkend="mprintf">mprintf</link>
+ </member>
+ <member>
+ <link linkend="mputl">mputl</link>
+ </member>
+ <member>
+ <link linkend="mputstr">mputstr</link>
+ </member>
+ <member>
+ <link linkend="mseek">mseek</link>
+ </member>
+ <member>
+ <link linkend="mtell">mtell</link>
+ </member>
+ <member>
+ <link linkend="mdelete">mdelete</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
-<?xml version="1.0" encoding="windows-1251"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA - Serge STEER
*
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="mputl" xml:lang="en">
- <refnamediv>
- <refname>mputl</refname>
- <refpurpose>writes strings in an ascii file</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>r = mputl(txt ,file_desc)</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>r</term>
- <listitem>
- <para>returns %t or %f to check if function has correctly written on
- the file.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>file_desc</term>
- <listitem>
- <para>A character string giving the name of the file or a logical
- unit returned by mopen.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>txt</term>
- <listitem>
- <para>a vector of strings.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- <literal>mputl</literal> function allows to write a vector of
- strings as a sequence of lines in an ascii file.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>mputl</refname>
+ <refpurpose>writes strings in a text file</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>r = mputl(txt, file_desc)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>r</term>
+ <listitem>
+ <para>
+ returns <literal>%t</literal> or <literal>%f</literal> to check
+ if function has correctly wrote on the file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>file_desc</term>
+ <listitem>
+ <para>
+ a character string giving the name of the file or
+ </para>
+ <para>
+ an integer scalar: a file descriptor returned by
+ <function>mopen</function> function.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>txt</term>
+ <listitem>
+ <para>a vector of strings.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <function>mputl</function> function allows to write a vector of
+ strings as a sequence of lines in a text file.
+ </para>
+ <para>
+ <function>mputl</function> supports strings encoded as ANSI/ASCII and UTF-8.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
fd = mopen(TMPDIR+'/text_mputl.txt','wt');
mputl('Hello World',fd);
mclose(fd);
disp(mgetl(fd));
mclose(fd);
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mget">mget</link>
- </member>
- <member>
- <link linkend="mgetl">mgetl</link>
- </member>
- <member>
- <link linkend="mclose">mclose</link>
- </member>
- <member>
- <link linkend="mfprintf">mfprintf</link>
- </member>
- <member>
- <link linkend="mput">mput</link>
- </member>
- <member>
- <link linkend="mputstr">mputstr</link>
- </member>
- <member>
- <link linkend="mopen">mopen</link>
- </member>
- <member>
- <link linkend="write">write</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="mget">mget</link>
+ </member>
+ <member>
+ <link linkend="mgetl">mgetl</link>
+ </member>
+ <member>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="mfprintf">mfprintf</link>
+ </member>
+ <member>
+ <link linkend="mput">mput</link>
+ </member>
+ <member>
+ <link linkend="mputstr">mputstr</link>
+ </member>
+ <member>
+ <link linkend="mopen">mopen</link>
+ </member>
+ <member>
+ <link linkend="write">write</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="mputstr">
- <refnamediv>
- <refname>mputstr</refname>
- <refpurpose> write a character string in a file</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>mputstr(str [, fd]);</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>fd</term>
- <listitem>
- <para>
- scalar. The <literal>fd</literal> parameter returned by the function <literal>mopen</literal>. -1 stands for last opened file. Default value is -1.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>str</term>
- <listitem>
- <para>a character string</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- mputstr function allows to write a character string in a binary file.
- </para>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mclose">mclose</link>
- </member>
- <member>
- <link linkend="meof">meof</link>
- </member>
- <member>
- <link linkend="mfprintf">mfprintf</link>
- </member>
- <member>
- <link linkend="fprintfMat">fprintfMat</link>
- </member>
- <member>
- <link linkend="mfscanf">mfscanf</link>
- </member>
- <member>
- <link linkend="fscanfMat">fscanfMat</link>
- </member>
- <member>
- <link linkend="mget">mget</link>
- </member>
- <member>
- <link linkend="mgetstr">mgetstr</link>
- </member>
- <member>
- <link linkend="mopen">mopen</link>
- </member>
- <member>
- <link linkend="mprintf">mprintf</link>
- </member>
- <member>
- <link linkend="mput">mput</link>
- </member>
- <member>
- <link linkend="mputstr">mputstr</link>
- </member>
- <member>
- <link linkend="mscanf">mscanf</link>
- </member>
- <member>
- <link linkend="mseek">mseek</link>
- </member>
- <member>
- <link linkend="mtell">mtell</link>
- </member>
- <member>
- <link linkend="mdelete">mdelete</link>
- </member>
- </simplelist>
- </refsection>
+ <refnamediv>
+ <refname>mputstr</refname>
+ <refpurpose>writes a character string in a file</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>mputstr(str [, fd]);</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>fd</term>
+ <listitem>
+ <para>
+ a scalar: a file descriptor returned by the function <function>mopen</function>. <literal>-1</literal> stands for last opened file. Default value is <literal>-1</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>str</term>
+ <listitem>
+ <para>a character string.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ The <function>mputstr</function> function allows to write a character string <varname>str</varname> in a binary file.
+ </para>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="meof">meof</link>
+ </member>
+ <member>
+ <link linkend="mfprintf">mfprintf</link>
+ </member>
+ <member>
+ <link linkend="fprintfMat">fprintfMat</link>
+ </member>
+ <member>
+ <link linkend="mfscanf">mfscanf</link>
+ </member>
+ <member>
+ <link linkend="fscanfMat">fscanfMat</link>
+ </member>
+ <member>
+ <link linkend="mget">mget</link>
+ </member>
+ <member>
+ <link linkend="mgetstr">mgetstr</link>
+ </member>
+ <member>
+ <link linkend="mopen">mopen</link>
+ </member>
+ <member>
+ <link linkend="mprintf">mprintf</link>
+ </member>
+ <member>
+ <link linkend="mput">mput</link>
+ </member>
+ <member>
+ <link linkend="mseek">mseek</link>
+ </member>
+ <member>
+ <link linkend="mtell">mtell</link>
+ </member>
+ <member>
+ <link linkend="mdelete">mdelete</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="mseek">
- <refnamediv>
- <refname>mseek</refname>
- <refpurpose> set current position in binary file. </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>mseek(n [,fd, flag])</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>n</term>
- <listitem>
- <para>a positive scalar: The offset from origin in number of bytes.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>fd</term>
- <listitem>
- <para>
- scalar. The <literal>fd</literal> parameter returned by the function <literal>mopen</literal>. -1 stands for last opened file. Default value is -1.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>flag</term>
- <listitem>
- <para>a string. specifies the origin. Default value 'set'.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- The function <literal>mseek()</literal> sets the position of the next input or output operation
- on the stream <literal>fd</literal>. The new position is at
- the signed distance given by <literal>n</literal> bytes from the beginning, from
- the current position, or from the end of the file, according to the
- <literal>flag</literal> value which can be <literal>'set'</literal>, <literal>'cur'</literal> or <literal>'end'</literal>.
- </para>
- <para>
- <literal>mseek()</literal> allows the file position indicator to be set beyond
- the end of the existing data in the file. If data is later
- written at this point, subsequent reads of data in the gap
- will return zero until data is actually written into the
- gap. <literal>mseek()</literal>, by itself, does not extend the size of the
- file.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
-file3='test3.bin'
+ <refnamediv>
+ <refname>mseek</refname>
+ <refpurpose>sets current position in a binary file</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>mseek(n [,fd, flag])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>n</term>
+ <listitem>
+ <para>a positive scalar: the offset from origin in a number of bytes.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>fd</term>
+ <listitem>
+ <para>
+ a scalar: a file descriptor returned by the function
+ <function>mopen</function>. <literal>-1</literal>
+ stands for last opened file. Default value is
+ <literal>-1</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>flag</term>
+ <listitem>
+ <para>
+ a string: specifies the origin. Default value <literal>'set'</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ The function <function>mseek</function> sets the position of the next input or output operation on the stream <varname>fd</varname>. The new position is at the signed distance given by <varname>n</varname> bytes from the beginning, from the current position, or from the end of the file, according to the <varname>flag</varname> value which can be <literal>'set'</literal>, <literal>'cur'</literal> or <literal>'end'</literal>.
+ </para>
+ <para>
+ <function>mseek</function> allows the file position indicator to be
+ set beyond the end of the existing data in the file. If data is
+ later written at this point, subsequent reads of data in the gap
+ will return zero until data is actually written into the gap.
+ <function>mseek</function>, by itself, does not extend the size of
+ the file.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+file3=fullfile(TMPDIR,'test3.bin');
fd1= mopen(file3,'wb');
-for i=1:10, mput(i,'d'); end
+for i=1:10
+ mput(i,'d');
+end
mseek(0);
mput(678,'d');
mseek(0,fd1,'end');
mput(932,'d');
mclose(fd1)
+
fd1= mopen(file3,'rb');
res=mget(11,'d')
res1=[1:11]; res1(1)=678;res1($)=932;
-if res1<>res ;write(%io(2),'Bug');end;
+if res1<>res then
+ write(%io(2),'Bug');
+end
mseek(0,fd1,'set');
// trying to read more than stored data
res1=mget(100,'d',fd1);
-if res1<>res ;write(%io(2),'Bug');end;
+if res1<>res then
+ write(%io(2),'Bug');
+end
meof(fd1)
mclearerr(fd1)
mclose(fd1);
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mclose">mclose</link>
- </member>
- <member>
- <link linkend="meof">meof</link>
- </member>
- <member>
- <link linkend="mfprintf">mfprintf</link>
- </member>
- <member>
- <link linkend="fprintfMat">fprintfMat</link>
- </member>
- <member>
- <link linkend="mfscanf">mfscanf</link>
- </member>
- <member>
- <link linkend="fscanfMat">fscanfMat</link>
- </member>
- <member>
- <link linkend="mget">mget</link>
- </member>
- <member>
- <link linkend="mgetstr">mgetstr</link>
- </member>
- <member>
- <link linkend="mopen">mopen</link>
- </member>
- <member>
- <link linkend="mprintf">mprintf</link>
- </member>
- <member>
- <link linkend="mput">mput</link>
- </member>
- <member>
- <link linkend="mputstr">mputstr</link>
- </member>
- <member>
- <link linkend="mscanf">mscanf</link>
- </member>
- <member>
- <link linkend="mseek">mseek</link>
- </member>
- <member>
- <link linkend="mtell">mtell</link>
- </member>
- <member>
- <link linkend="mdelete">mdelete</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="meof">meof</link>
+ </member>
+ <member>
+ <link linkend="mfprintf">mfprintf</link>
+ </member>
+ <member>
+ <link linkend="fprintfMat">fprintfMat</link>
+ </member>
+ <member>
+ <link linkend="mfscanf">mfscanf</link>
+ </member>
+ <member>
+ <link linkend="fscanfMat">fscanfMat</link>
+ </member>
+ <member>
+ <link linkend="mget">mget</link>
+ </member>
+ <member>
+ <link linkend="mgetstr">mgetstr</link>
+ </member>
+ <member>
+ <link linkend="mopen">mopen</link>
+ </member>
+ <member>
+ <link linkend="mprintf">mprintf</link>
+ </member>
+ <member>
+ <link linkend="mput">mput</link>
+ </member>
+ <member>
+ <link linkend="mputstr">mputstr</link>
+ </member>
+ <member>
+ <link linkend="mtell">mtell</link>
+ </member>
+ <member>
+ <link linkend="mdelete">mdelete</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="mtell">
- <refnamediv>
- <refname>mtell</refname>
- <refpurpose> binary file management</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>mtell([fd])</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>fd</term>
- <listitem>
- <para>
- scalar. The <literal>fd</literal> parameter returned by the function <literal>mopen</literal>. -1 stands for last opened file. Default value is -1.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- The function <literal>mtell()</literal> returns the offset of the current byte relative to
- the beginning of the file associated with the named stream <literal>fd</literal>.
- </para>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mclose">mclose</link>
- </member>
- <member>
- <link linkend="meof">meof</link>
- </member>
- <member>
- <link linkend="mfprintf">mfprintf</link>
- </member>
- <member>
- <link linkend="fprintfMat">fprintfMat</link>
- </member>
- <member>
- <link linkend="mfscanf">mfscanf</link>
- </member>
- <member>
- <link linkend="fscanfMat">fscanfMat</link>
- </member>
- <member>
- <link linkend="mget">mget</link>
- </member>
- <member>
- <link linkend="mgetstr">mgetstr</link>
- </member>
- <member>
- <link linkend="mopen">mopen</link>
- </member>
- <member>
- <link linkend="mprintf">mprintf</link>
- </member>
- <member>
- <link linkend="mput">mput</link>
- </member>
- <member>
- <link linkend="mputstr">mputstr</link>
- </member>
- <member>
- <link linkend="mscanf">mscanf</link>
- </member>
- <member>
- <link linkend="mseek">mseek</link>
- </member>
- <member>
- <link linkend="mtell">mtell</link>
- </member>
- <member>
- <link linkend="mdelete">mdelete</link>
- </member>
- </simplelist>
- </refsection>
+ <refnamediv>
+ <refname>mtell</refname>
+ <refpurpose>binary file management</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>mtell([fd])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>fd</term>
+ <listitem>
+ <para>
+ a scalar: a file descriptor returned by the function
+ <function>mopen</function>. <literal>-1</literal>
+ stands for last opened file. Default value is
+ <literal>-1</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ The function <function>mtell</function> returns the offset of the
+ current byte relative to the beginning of the file associated with
+ the named stream <varname>fd</varname>.
+ </para>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="meof">meof</link>
+ </member>
+ <member>
+ <link linkend="mfprintf">mfprintf</link>
+ </member>
+ <member>
+ <link linkend="fprintfMat">fprintfMat</link>
+ </member>
+ <member>
+ <link linkend="mfscanf">mfscanf</link>
+ </member>
+ <member>
+ <link linkend="fscanfMat">fscanfMat</link>
+ </member>
+ <member>
+ <link linkend="mget">mget</link>
+ </member>
+ <member>
+ <link linkend="mgetstr">mgetstr</link>
+ </member>
+ <member>
+ <link linkend="mopen">mopen</link>
+ </member>
+ <member>
+ <link linkend="mprintf">mprintf</link>
+ </member>
+ <member>
+ <link linkend="mput">mput</link>
+ </member>
+ <member>
+ <link linkend="mputstr">mputstr</link>
+ </member>
+ <member>
+ <link linkend="mseek">mseek</link>
+ </member>
+ <member>
+ <link linkend="mdelete">mdelete</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="newest">
- <refnamediv>
- <refname>newest</refname>
- <refpurpose> returns newest file of a set of files</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>k=newest(paths)
- k=newest(path1,path2,...,pathn)
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>k</term>
- <listitem>
- <para>the index of the newest file</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>paths</term>
- <listitem>
- <para>a character string vector, paths(i) is the pathname of ith file</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>pathi</term>
- <listitem>
- <para>a character string, the pathname of ith file</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- Given a set of pathnames newest returns the index of the newest
- one. Non existant files are supposed to be the oldest.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>newest</refname>
+ <refpurpose>returns newest file of a set of files</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>k = newest(paths)
+ k = newest(path1, path2, ..., pathn)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>k</term>
+ <listitem>
+ <para>an integer: the index of the newest file.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>paths</term>
+ <listitem>
+ <para>
+ a character string vector, <code>paths(i)</code> is the pathname of <literal>i</literal>-th file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>pathi</term>
+ <listitem>
+ <para>
+ a character string, the pathname of <literal>i</literal>-th file
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ Given a set of pathnames <function>newest</function> returns the index of the newest
+ one. Non existant files are supposed to be the oldest.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
newest('SCI/modules/graphics/macros/bode.sci','SCI/modules/graphics/macros/bode.bin')
newest(['SCI/modules/graphics/macros/bode.sci','SCI/modules/graphics/macros/bode.bin'])
newest('SCI/modules/graphics/macros/bode.'+['sci','bin'])
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="fileinfo">fileinfo</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="fileinfo">fileinfo</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="pathconvert">
- <refnamediv>
- <refname>pathconvert</refname>
- <refpurpose> pathnames convertion between POSIX and windows. </refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>paths=pathconvert(paths [,flagtrail [,flagexpand [,type]]])</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>paths</term>
- <listitem>
- <para>a string matrix giving a set of pathnames</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>flagtrail</term>
- <listitem>
- <para>boolean optional parameters. Its default value is TRUE.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>flagexpand</term>
- <listitem>
- <para>boolean optional parameter. Its default value depends on the getos() == 'Windows' variable.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>type</term>
- <listitem>
- <para>
- a string <literal>'u'</literal> or <literal>'w'</literal>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>
- <literal>pathconvert</literal> can be used to convert a set of pathnames
- (given by a string matrix <literal>paths</literal>) from windows native
- filename to POSIX-style pathnames and back. The target style
- is given by the optional string <literal>type</literal> which can be
- <literal>'u'</literal> for Unix or <literal>'w'</literal> for Windows. The default
- style is set according to the value of <literal>getos() == 'Windows'</literal>.
- If <literal>getos() == 'Windows'</literal> is TRUE (resp. FALSE ) then default type is <literal>'w'</literal>
- (resp. <literal>'u'</literal>).
- </para>
- <para>
- Windows pathnames starting with <literal>name:</literal> are converted to
- pathnames starting with <literal>/cygdrive/name/</literal> using the cygwin
- convention.
- </para>
- <para>
- <literal>flagtrail</literal> is an optional boolean parameter. When its value
- is TRUE (default value) a trailing separator (<literal>'\'</literal> or <literal>'/'</literal>) is added
- at the end of the path if it was missing. If <literal>flagtrail</literal> is
- set to FALSE, the trailing separator is removed.
- </para>
- <para>
- <literal>flagexpand</literal> is an optional boolean parameter. When its value
- is TRUE leading strings like <literal>HOME</literal>, <literal>SCI</literal> or <literal>~</literal> are
- expanded using environment variables.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>pathconvert</refname>
+ <refpurpose> pathnames convertion between POSIX and Windows. </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>paths=pathconvert(paths [,flagtrail [,flagexpand [,type]]])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>paths</term>
+ <listitem>
+ <para>a string matrix giving a set of pathnames</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>flagtrail</term>
+ <listitem>
+ <para>
+ a boolean optional parameter. Its default value is <constant>%t</constant>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>flagexpand</term>
+ <listitem>
+ <para>
+ a boolean optional parameter. Its default value depends on the result of <code>getos() == 'Windows'</code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>type</term>
+ <listitem>
+ <para>
+ a string <literal>'u'</literal> or <literal>'w'</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <function>pathconvert</function> can be used to convert a set of pathnames
+ (given by a string matrix <varname>paths</varname>) from Windows native
+ filename to POSIX-style pathnames and back. The target style
+ is given by the optional string <varname>type</varname> which can be
+ <literal>'u'</literal> for Unix or <literal>'w'</literal> for Windows. The default
+ style is set according to the value of <code>getos() == 'Windows'</code>.
+ If <code>getos() == 'Windows'</code> is <constant>%t</constant> (resp. <constant>%f</constant> ) then default type is <literal>'w'</literal>
+ (resp. <literal>'u'</literal>).
+ </para>
+ <para>
+ Windows pathnames starting with <literal>name:</literal> are converted to
+ pathnames starting with <literal>/cygdrive/name/</literal> using the cygwin
+ convention.
+ </para>
+ <para>
+ <varname>flagtrail</varname> is an optional boolean parameter. When its value
+ is <constant>%t</constant> (default value) a trailing separator (<literal>'\'</literal> or <literal>'/'</literal>) is added
+ at the end of the path if it was missing. If <varname>flagtrail</varname> is
+ set to <constant>%f</constant>, the trailing separator is removed.
+ </para>
+ <para>
+ <varname>flagexpand</varname> is an optional boolean parameter. When its value
+ is <constant>%t</constant> leading strings like <varname>HOME</varname>, <varname>SCI</varname> or <literal>~</literal> are
+ expanded using environment variables.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
pathconvert("SCI/modules/fileio\macros/foo.sci",%f,%f,"u")
pathconvert("SCI/modules/fileio\macros/foo.sci",%f,%f,"w")
pathconvert("SCI/modules/fileio/macros/foo.sci",%f,%t,"w")
pathconvert("c:/tmp",%f,%t,"u")
pathconvert("/cygdrive/c/tmp",%f,%f,"w")
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="basename">basename</link>
- </member>
- <member>
- <link linkend="listfiles">listfiles</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="basename">basename</link>
+ </member>
+ <member>
+ <link linkend="listfiles">listfiles</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="pathsep">
- <refnamediv>
- <refname>pathsep</refname>
- <refpurpose>returns path separator for current platform</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>s = pathsep()</synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Arguments</title>
- <variablelist>
- <varlistentry>
- <term>s</term>
- <listitem>
- <para>a string</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
- <refsection>
- <title>Description</title>
- <para>returns path separator. ( ':' on Linux or ';' on Windows )</para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>pathsep</refname>
+ <refpurpose>returns path separator for current platform</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>s = pathsep()</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>s</term>
+ <listitem>
+ <para>a string</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <function>pathsep</function> returns path separator (<literal>':'</literal> on GNU/Linux or <literal>';'</literal> on Windows ).
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
pathsep()
]]></programlisting>
- </refsection>
+ </refsection>
</refentry>
<?xml version="1.0" encoding="UTF-8"?>
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="pwd">
- <refnamediv>
- <refname>pwd</refname>
- <refpurpose> print Scilab current directory</refpurpose>
- </refnamediv>
- <refnamediv>
- <refname>pwd</refname>
- <refpurpose> get Scilab current directory</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>pwd
- x=pwd()
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Description</title>
- <para>
- <literal>pwd</literal> returns in <literal>ans</literal> the Scilab current directory.
- <literal>x=pwd()</literal> returns in <literal>x</literal> the Scilab current
- directory.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>pwd</refname>
+ <refpurpose>gets Scilab current directory</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>pwd
+ x=pwd()
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <code>pwd</code> returns in <varname>ans</varname> the Scilab current directory.
+ <code>x=pwd()</code> returns in <varname>x</varname> the Scilab current
+ directory.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
pwd
x=pwd()
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="chdir">chdir</link>
- </member>
- <member>
- <link linkend="cd">cd</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="chdir">chdir</link>
+ </member>
+ <member>
+ <link linkend="cd">cd</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="removedir">
- <refnamediv>
- <refname>removedir</refname>
- <refpurpose>Remove a directory</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>removedir('dirname')
- [status] = removedir('dirname','s')
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Description</title>
- <para>removedir('dirname') removes the directory dirname from the current
- directory. If the directory is not empty, files and subdirectories are removed. If
- dirname is not in the current directory, specify the relative path to the
- current directory or the full path for dirname.
- </para>
- <para>[status] = removedir('dirname') removes the directory dirname
- and its contents from the current directory, returning the status.
- Here, status is %T for success and is %F for error.
- </para>
- <para>removedir is used by rmdir.</para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>removedir</refname>
+ <refpurpose>removes a directory</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>
+ removedir(dirname)
+ [status] = removedir(dirname)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>dirname</term>
+ <listitem>
+ <para>a character string.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>status</term>
+ <listitem>
+ <para>a boolean.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <code>removedir(dirname)</code> removes the directory <varname>dirname</varname> from the current directory. If the directory is not empty, files and subdirectories are removed. If <varname>dirname</varname> is not in the current directory, specify the relative path to the current directory or the full path for <varname>dirname</varname>.
+ </para>
+ <para>[
+ <code>[status] = removedir(dirname)</code> removes the directory <varname>dirname</varname> and its contents from the current directory, returning the status. Here, <varname>status</varname> is <constant>%T</constant> for success and is <constant>%F</constant> for error.
+ </para>
+ <para>
+ <function>removedir</function> is used by <function>rmdir</function>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
createdir(SCIHOME+'/Directory_test')
removedir(SCIHOME+'/Directory_test')
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="mkdir">mkdir</link>
- </member>
- <member>
- <link linkend="rmdir">rmdir</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="createdir">createdir</link>
+ </member>
+ <member>
+ <link linkend="mkdir">mkdir</link>
+ </member>
+ <member>
+ <link linkend="rmdir">rmdir</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
*
-->
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="rmdir">
- <refnamediv>
- <refname>rmdir</refname>
- <refpurpose>Remove a directory</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <title>Calling Sequence</title>
- <synopsis>rmdir('dirname')
- rmdir('dirname','s')
- [status,message] = rmdir('dirname','s')
- </synopsis>
- </refsynopsisdiv>
- <refsection>
- <title>Description</title>
- <para>rmdir('dirname') removes the directory dirname from the current
- directory. If the directory is not empty, you must use the s argument. If
- dirname is not in the current directory, specify the relative path to the
- current directory or the full path for dirname.
- </para>
- <para>rmdir('dirname','s') removes the directory dirname and its contents
- from the current directory.
- </para>
- <para>[status, message] = rmdir('dirname','s') removes the directory dirname
- and its contents from the current directory, returning the status, and a
- message. Here, status is 1 for success and is 0 for error.
- </para>
- </refsection>
- <refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
+ <refnamediv>
+ <refname>rmdir</refname>
+ <refpurpose>removes a directory</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>
+ rmdir(dirname)
+ rmdir(dirname,'s')
+ [status, message] = rmdir(dirname,'s')
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>dirname</term>
+ <listitem>
+ <para>a character string.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>'s'</term>
+ <listitem>
+ <para>
+ a mark to remove directory <varname>dirname</varname> with
+ subdirectories.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>status</term>
+ <listitem>
+ <para>a boolean.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>message</term>
+ <listitem>
+ <para>
+ a character string: a message about an error.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <code>rmdir(dirname)</code> removes the directory
+ <varname>dirname</varname> from the current directory. If the
+ directory is not empty, you must use the s argument. If
+ <varname>dirname</varname> is not in the current directory, specify
+ the relative path to the current directory or the full path for
+ <varname>dirname</varname>.
+ </para>
+ <para>
+ <code>rmdir(dirname,'s')</code> removes the directory <varname>dirname</varname> and its contents from the current directory.
+ </para>
+ <para>
+ <code>[status, message] = rmdir(dirname,'s')</code> removes the
+ directory <varname>dirname</varname> and its contents from the
+ current directory, returning the status, and a message. Here,
+ <varname>status</varname> is 1 for success and is 0 for error.
+ </para>
+ <para>
+ Whatever the operating system, if the removing of directory
+ succeeds, the <varname>status</varname> is 1 and the message
+ <varname>message</varname> is empty.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
mkdir(SCI,'Directory')
rmdir(SCI+'/Directory')
]]></programlisting>
- </refsection>
- <refsection role="see also">
- <title>See Also</title>
- <simplelist type="inline">
- <member>
- <link linkend="cd">cd</link>
- </member>
- <member>
- <link linkend="dir">dir</link>
- </member>
- <member>
- <link linkend="mkdir">mkdir</link>
- </member>
- </simplelist>
- </refsection>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="createdir">createdir</link>
+ </member>
+ <member>
+ <link linkend="mkdir">mkdir</link>
+ </member>
+ <member>
+ <link linkend="removedir">removedir</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>