Name
Generic output event -- Writing simulation data
Description
This generic object is a GfsEvent which also defines where to write the data to output.
The syntax in parameter files is as follows:
where FILE is a string defining the file in which to write the output. Two file names have special meaning: "stderr" and "stdout" for the standard error and standard output respectively.
If a C-like formatting string appears in the file name, it is interpreted as follows:
Note that most of the C language format specifiers are recognized (i.e. it is possible to use formatting strings like %
05.2f etc...).
By default existing files are not overwritten but appended.
Details
GFS_OUTPUT_CLASS()
#define GFS_OUTPUT_CLASS(klass) |
GFS_IS_OUTPUT()
#define GFS_IS_OUTPUT(obj) |
struct GfsOutput
struct GfsOutput {
GfsEvent parent;
GfsOutputFile * file;
gchar * format;
GSList * formats;
gboolean dynamic;
}; |
struct GfsOutputFile
struct GfsOutputFile {
guint refcount;
gchar * name;
FILE * fp;
}; |
gfs_output_mute ()
"Mutes" the output defined by output, the event associated with
output still takes place but the output itself is redirected to
/dev/null.
gfs_output_file_close ()
Decreases the reference count of file. If it reaches zero the file
corresponding to file is closed and file is freed.
gfs_output_file_open ()
Checks whether name has already been opened. If it has, its
reference count is incremented and the corresponding GfsOutputFile
is returned. If it has not, it is created and opened for writing.