<id /> !
|Eid||String||Identifier of the file which you want to close.|
In the example, A file with a text and its associated stream are created and the information contained in the file is read through the stream. Then the stream is closed. You can see that at the end there is a commented line. Here you try to read the stream again once closed, if you execute it with the line without comment, you can see how there is an error because it would try to read the stream already closed.
<xsql-script name='file_close_sample1'> <body> <set name='my_file'> <string>my_file.txt</string> </set> <file.bytes.write> <file name='#my_file'/> <string.getBytes>file's text</string.getBytes> </file.bytes.write> <set name = 'm_file'> <file name='my_file.txt'/> </set> <set name = 'is1'> <file.in.open id='in1'> <m_file/> </file.in.open> </set> <println><file.in.readAll id='in1' /></println> <file.in.close id='in1'> </file.in.close> <!-- <println><file.in.readAll id='in1' /></println> --> </body> </xsql-script>