32 lines
992 B
Plaintext
32 lines
992 B
Plaintext
/* NetRexx */
|
|
options replace format comments java crossref symbols binary
|
|
|
|
runSample(arg)
|
|
return
|
|
|
|
-- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
|
method makeTempFile(prefix = String, suffix = String null, startDir = String null) -
|
|
public static signals IOException returns File
|
|
if startDir \= null then fStartDir = File(startDir)
|
|
else fStartDir = null
|
|
ff = File.createTempFile(prefix, suffix, fStartDir)
|
|
ff.deleteOnExit() -- make sure the file is deleted at termination
|
|
return ff
|
|
|
|
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
method runSample(arg) private static
|
|
do
|
|
tempFiles = [ -
|
|
makeTempFile('rexx'), -
|
|
makeTempFile('rexx', '.rex'), -
|
|
makeTempFile('rexx', null, './tmp') -
|
|
]
|
|
loop fFile over tempFiles
|
|
fName = fFile.getCanonicalPath()
|
|
say 'Temporary file:' fName
|
|
end fFile
|
|
catch ex = IOException
|
|
ex.printStackTrace()
|
|
end
|
|
return
|