cctools
|
Describes a single input or output file of a batch job. More...
#include <errno.h>
#include <sys/types.h>
#include <dirent.h>
#include "sha1.h"
#include "list.h"
#include "debug.h"
#include "path.h"
Go to the source code of this file.
Data Structures | |
struct | batch_file |
Internal description of a single file used by a batch job. More... | |
Functions | |
struct batch_file * | batch_file_create (const char *outer_name, const char *inner_name) |
Create batch_file struct. | |
void | batch_file_delete (struct batch_file *f) |
Delete batch_file struct. | |
char * | batch_file_to_string (struct batch_file *f) |
Output batch_file as a string. | |
char * | batch_file_list_to_string (struct list *file_list) |
Output list of batch_files as a string. | |
int | batch_file_outer_compare (struct batch_file *f1, struct batch_file *f2) |
Compare function for comparing batch_files based on outer_name. | |
char * | batch_file_generate_id (struct batch_file *f) |
Generate a sha1 hash based on the file contents. | |
char * | batch_file_generate_id_dir (char *file_name) |
Generates a sha1 hash based on the directory's contents. | |
Describes a single input or output file of a batch job.
For each input/output file consumed/produced by a single batch_job, a batch_file object describes the name of the file as the submitter sees it (outer_name) and the intended name of the file as seen by the running job (inner_name). Many (but not all) batch systems execute jobs in a sandbox that permits these two names to be different. Some batch systems do not permit these names to differ.
struct batch_file * batch_file_create | ( | const char * | outer_name, |
const char * | inner_name | ||
) |
Create batch_file struct.
outer_name | A pointer to the file's name host/submission side. |
inner_name | A pointer to the file's name execution side. |
void batch_file_delete | ( | struct batch_file * | f | ) |
Delete batch_file struct.
This includes freeing host_name and exe_name if defined.
file | A batch_file struct to be deleted. |
char * batch_file_to_string | ( | struct batch_file * | f | ) |
Output batch_file as a string.
Format is "outer_name=inner_name" when renaming is needed. and just "outer_name" when it is not.
file | A batch_file struct to be stringified. |
char * batch_file_list_to_string | ( | struct list * | file_list | ) |
Output list of batch_files as a string.
Format is "FILE,FILE,...,FILE" where file is the result of batch_file_to_string.
files | A list struct containing batch_file structs. |
int batch_file_outer_compare | ( | struct batch_file * | f1, |
struct batch_file * | f2 | ||
) |
Compare function for comparing batch_files based on outer_name.
file1 | First file to compare. |
file2 | Second file to compare. |
char * batch_file_generate_id | ( | struct batch_file * | f | ) |
Generate a sha1 hash based on the file contents.
f | The batch_file whose checksum will be generated. |
char * batch_file_generate_id_dir | ( | char * | file_name | ) |
Generates a sha1 hash based on the directory's contents.
file_name | The directory that will be checked |