Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
import Nanoquery.IO
|
||||
|
||||
def guaranteedTempFile()
|
||||
// create a file object to generate temp file names
|
||||
$namegen = new(File)
|
||||
|
||||
// generate a temp filename
|
||||
$tempname = $namegen.tempFileName()
|
||||
|
||||
// file names are generated with uuids so they shouldn't repeat
|
||||
// in the case that they do, generate new ones until the generated
|
||||
// filename is unique
|
||||
$tempfile = new(File, $tempname)
|
||||
while ($tempfile.exists())
|
||||
$tempname = $namegen.tempFileName()
|
||||
$tempfile = new(File, $tempname)
|
||||
end
|
||||
|
||||
// create the file and lock it from writing
|
||||
$tempfile.create()
|
||||
lock $tempfile.fullPath()
|
||||
|
||||
// return the file reference
|
||||
return $tempfile
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue