Debian Codegraph @

info/gcl/close.html

raw
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>close (ANSI and GNU Common Lisp Document)</title>
7
8 <meta name="description" content="close (ANSI and GNU Common Lisp Document)">
9 <meta name="keywords" content="close (ANSI and GNU Common Lisp Document)">
10 <meta name="resource-type" content="document">
11 <meta name="distribution" content="global">
12 <meta name="Generator" content="makeinfo">
13 <link href="index.html" rel="start" title="Top">
14 <link href="Streams-Dictionary.html" rel="up" title="Streams Dictionary">
15 <link href="with_002dopen_002dstream.html" rel="next" title="with-open-stream">
16 <link href="with_002dopen_002dfile.html" rel="prev" title="with-open-file">
17 <style type="text/css">
18 <!--
19 a.summary-letter {text-decoration: none}
20 blockquote.indentedblock {margin-right: 0em}
21 div.display {margin-left: 3.2em}
22 div.example {margin-left: 3.2em}
23 div.lisp {margin-left: 3.2em}
24 kbd {font-style: oblique}
25 pre.display {font-family: inherit}
26 pre.format {font-family: inherit}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 span.nolinebreak {white-space: nowrap}
30 span.roman {font-family: initial; font-weight: normal}
31 span.sansserif {font-family: sans-serif; font-weight: normal}
32 ul.no-bullet {list-style: none}
33 -->
34 </style>
35
36
37 </head>
38
39 <body lang="en">
40 <span id="close"></span><div class="header">
41 <p>
42 Next: <a href="with_002dopen_002dstream.html" accesskey="n" rel="next">with-open-stream</a>, Previous: <a href="with_002dopen_002dfile.html" accesskey="p" rel="prev">with-open-file</a>, Up: <a href="Streams-Dictionary.html" accesskey="u" rel="up">Streams Dictionary</a> &nbsp; </p>
43 </div>
44 <hr>
45 <span id="close-_005bFunction_005d"></span><h4 class="subsection">21.2.32 close [Function]</h4>
46
47 <p><code>close</code> <i>stream <span class="roman">&amp;key</span> abort</i> &rArr; <i>result</i>
48 </p>
49 <span id="Arguments-and-Values_003a_003a-433"></span><h4 class="subsubheading">Arguments and Values::</h4>
50
51 <p><i>stream</i>&mdash;a <i>stream</i> (either <i>open</i> or <i>closed</i>).
52 </p>
53 <p><i>abort</i>&mdash;a <i>generalized boolean</i>.
54 The default is <i>false</i>.
55 </p>
56 <p><i>result</i>&mdash;<b>t</b> if the <i>stream</i> was <i>open</i> at the time it was
57 received as an <i>argument</i>,
58 or <i>implementation-dependent</i> otherwise.
59 </p>
60 <span id="Description_003a_003a-563"></span><h4 class="subsubheading">Description::</h4>
61
62 <p><b>close</b> closes <i>stream</i>.
63 Closing a <i>stream</i> means
64 that it may no longer be used in input or output operations.
65 The act of <i>closing</i> a <i>file stream</i>
66 ends the association between the <i>stream</i> and its associated <i>file</i>;
67 the transaction with the <i>file system</i> is terminated,
68 and input/output may no longer be performed on the <i>stream</i>.
69 </p>
70 <p>If <i>abort</i> is <i>true</i>, an attempt is made to clean up any side
71 effects of having created <i>stream</i>.
72 If <i>stream</i> performs output to a file
73 that was created when the <i>stream</i> was created, the
74 file is deleted and any previously existing file is not superseded.
75 </p>
76 <p>It is permissible to close an already closed <i>stream</i>,
77 but in that case the <i>result</i> is <i>implementation-dependent</i>.
78 </p>
79 <p>After <i>stream</i> is closed, it is still possible to perform
80 the following query operations upon it:
81 </p>
82 <p><b>streamp</b>, <b>pathname</b>, <b>truename</b>,
83 <b>merge-pathnames</b>, <b>pathname-host</b>, <b>pathname-device</b>,
84 <b>pathname-directory</b>,<b>pathname-name</b>,
85 <b>pathname-type</b>, <b>pathname-version</b>, <b>namestring</b>,
86 <b>file-namestring</b>, <b>directory-namestring</b>,
87 <b>host-namestring</b>, <b>enough-namestring</b>, <b>open</b>,
88 <b>probe-file</b>, and <b>directory</b>.
89 </p>
90 <p>The effect of <b>close</b> on a <i>constructed stream</i> is
91 to close the argument <i>stream</i> only.
92 There is no effect on the <i>constituents</i> of <i>composite streams</i>.
93 </p>
94 <p>For a <i>stream</i> created with <b>make-string-output-stream</b>,
95 the result of <b>get-output-stream-string</b> is unspecified after <b>close</b>.
96 </p>
97 <span id="Examples_003a_003a-409"></span><h4 class="subsubheading">Examples::</h4>
98
99 <div class="example">
100 <pre class="example"> (setq s (make-broadcast-stream)) &rArr; #&lt;BROADCAST-STREAM&gt;
101 (close s) &rArr; T
102 (output-stream-p s) &rArr; <i>true</i>
103 </pre></div>
104
105 <span id="Side-Effects_003a_003a-68"></span><h4 class="subsubheading">Side Effects::</h4>
106
107 <p>The <i>stream</i> is <i>closed</i> (if necessary).
108 If <i>abort</i> is <i>true</i> and the <i>stream</i> is
109 an <i>output</i> <i>file stream</i>, its associated <i>file</i>
110 might be deleted.
111 </p>
112 <span id="See-Also_003a_003a-459"></span><h4 class="subsubheading">See Also::</h4>
113
114 <p><a href="open.html">open</a>
115 </p>
116 <hr>
117 <div class="header">
118 <p>
119 Next: <a href="with_002dopen_002dstream.html" accesskey="n" rel="next">with-open-stream</a>, Previous: <a href="with_002dopen_002dfile.html" accesskey="p" rel="prev">with-open-file</a>, Up: <a href="Streams-Dictionary.html" accesskey="u" rel="up">Streams Dictionary</a> &nbsp; </p>
120 </div>
121
122
123
124 </body>
125 </html>