int get_output_file_path(RESULT const&, std::string&);
Returns the path of a result's output file (parses result.xml_doc_out and computes the file's position in the hierarchical directory structure).

Note: this function doesn't handle multiple output files (if there are multiple files, it returns the path of the first one). If your application has multiple output files, see below.


int try_fopen(char* path, FILE*& f, char* mode);
Open a file, distinguishing between recoverable and nonrecoverable errors. Returns zero on success. Returns ERR_FOPEN if the directory is present but not the file (this is considered a nonrecoverable error). Returns ERR_OPENDIR if the directory is not there (this is generally a recoverable error, like NFS mount failure).
double median_mean_credit(vector const& results);
Given a vector of N correct results, computes a canonical credit as follows:

Multiple output files

If your application has multiple output files you'll need to generalize get_output_file_path(). To do this you'll need to know the following:

The database field 'result.xml_doc_out' describes a result's output files. It has the form

",htmlspecialchars("
...
[ ... ]

    foobar
    blah
    blah
    ...
    [ ... ]

"),"
The components are:

The XML document describing the sizes and checksums of the output files is a list of <file_info> elements, with the nbytes and md5_cksum fields present. The project back end must parse this field to find the locations and checksums of output files. "; page_tail(); ?>