19.0.0 released Nov 08, 2023
Purpose: Create a new empty file with a unique name.
uniq-file [ define ] <file name> [ temporary ]
One of the common tasks in many applications is creating a unique file (of any kind, including temporary). uniq-file statement does that - it creates a new unique file of zero size, with <file name> being its fully qualified name, which is always within the file-storage. <file name> is allocated memory.
If string variable <file name> does not exist, it can be created with "define" clause. The file itself is created empty. If "temporary" clause is used, then the file created is a temporary-file.
The file has no extension. You can rename it after it has been created to reflect its usage or purpose.
All files created are setup with owner and group read/write only permissions.
The following creates an empty file with auto-generated name that will be stored in "mydoc" variable. String variable "mydoc" is defined in the statement. The string "some data" is written to a newly created file:
uniq-file define mydoc
write-file mydoc from "some data"
To create a temporary file:
uniq-file define temp_file temporary
You are free to copy, redistribute and adapt this web page (even commercially), as long as you give credit and provide a dofollow link back to this page - see full license at CC-BY-4.0
. Copyright (c) 2019-2023 Dasoftver LLC. Vely and elephant logo are trademarks of Dasoftver LLC. The software and information on this web site are provided "AS IS" and without any warranties or guarantees of any kind. Icons from table-icons.io
copyright Paweł Kuna, licensed under MIT