CCP4i: Graphical User Interface | |
Documentation for Programmers | |
OpenTmpScriptFile |
OpenTmpScriptFile - open a temporary script file to contain program script input
OpenTmpScriptFile script_filename channel [mode]
Open a temporary file to be used as the script input to a program. The file name, generated automatically, is projectname_jobnumber_filenumber_com.tmp, and the name is returned in script_filename. The file is opened and the channel id is returned in channel. By default the file is opened in w+ mode, which is write enabled and appending to any existing file of the same name (see Tcl documentation on file open) but this can be overridden by an optional mode.
For all but the very simplest scripts, it is easier to generate the script using CreateComScript and a template file. Use OpenTmpScriptFile with WriteTmpFile to write a file explicitly, and remember to close the file with 'CloseFile $channel'.
See the file $CCP4I_top/script/import.script for an example of the use of OpenTmpScriptFile.