Creates automatically a new and empty file with the name of its abstract pathname if there is not yet a file with that name.
1 file.createNewFile
<file.createNewFile>
<file /> !
</file.createNewFile>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Efile | File | String of bytes to copy, this can be obtained directly from a file or from a string of characters InputStream. |
Returns | |
---|---|
Type | Description |
Boolean | Returns true if the name did not already exist and the file was created successfully and false in the case that a file with this name already exists. |
Example
Copy a file of a directory to another.
Copy
<xsql-script name='file_copy_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> <println> <file.createNewFile> <m_file/> </file.createNewFile> </println> </body> </xsql-script>