Debian Codegraph @

opcodes/ficlose.xml

raw symbols SCIP
1
2 <refentry id="ficlose">
3 <indexterm id="IndexFiclose"><primary>ficlose</primary></indexterm>
4 <refentryinfo><title>Signal I/O:File I/O</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>ficlose</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>ficlose</refname>
11 <refpurpose>
12 Closes a previously opened file.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 <emphasis>ficlose</emphasis> can be used to close a file which was opened with <link linkend="fiopen"><citetitle>fiopen</citetitle></link>.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis><command>ficlose</command> ihandle</synopsis>
26 <synopsis><command>ficlose</command> Sfilename</synopsis>
27 </refsect1>
28
29 <refsect1>
30 <title>Initialization</title>
31 <para>
32 <emphasis>ihandle</emphasis> -- a number which identifies this file (generated by a previous <link linkend="fiopen"><citetitle>fiopen</citetitle></link>).
33 </para>
34
35 <para>
36 <emphasis>Sfilename</emphasis> -- A string in double quotes or string variable with the filename. The full path must be given if the file directory is not in the system PATH and is not present in the current directory.
37 </para>
38 </refsect1>
39
40 <refsect1>
41 <title>Performance</title>
42 <para>
43 <emphasis>ficlose</emphasis> closes a file which was previously opened with <link linkend="fiopen"><citetitle>fiopen</citetitle></link>. <emphasis>ficlose</emphasis> is only needed if you need to read a file written to during the same csound performance, since only when csound ends a performance does it close and save data in all open files. The opcode <emphasis>ficlose</emphasis> is useful for instance if you want to save presets within files which you want to be accesible without having to terminate csound.
44 </para>
45 <note>
46 <para>If you do not need this functionality it is safer not to call <emphasis>ficlose</emphasis>, and just let csound close the files when it exits.</para>
47 </note>
48
49 <para>
50 If a files closed with <emphasis>ficlose</emphasis> is being accessed by another opcode (like <link linkend="fout"><citetitle>fout</citetitle></link> or <link linkend="foutk"><citetitle>foutk</citetitle></link>), it will be closed later when it is no longer being used.
51 </para>
52 <warning>
53 <para>This opcode should be used with care, as the file handle will become invalid, and will cause an init error when an opcode tries to access the closed file.</para>
54 </warning>
55 </refsect1>
56
57 <refsect1>
58 <title>Examples</title>
59 <para>
60 Here is an example of the ficlose opcode. It uses the file <ulink url="examples/ficlose.csd"><citetitle>ficlose.csd</citetitle></ulink>.
61 <example>
62 <title>Example of the ficlose opcode.</title>
63 <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
64 <xi:include href="examples-xml/ficlose.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
65 </example>
66 </para>
67 </refsect1>
68
69 <refsect1>
70 <title>See also</title>
71 <para><link linkend="SigioFileIO"><citetitle>File Input and Output</citetitle></link></para>
72 </refsect1>
73
74 <refsect1>
75 <title>Credits</title>
76 <para>
77 <simplelist>
78 <member>Author: &namegabriel;</member>
79 <member>Italy</member>
80 <member>1999</member>
81 </simplelist>
82 </para>
83
84 <para>New in Csound version 5.02</para>
85 </refsect1>
86 </refentry>