Dependency perl code

Dependency file

The dependency file contains all the instructions which are used by the DPC to update the file system. By default the dependency file is called dependencies.dat, but the name can be changed by using the --depend argument (see arguments page).

For each line in the dependency file there are three possible entries:

  1. comments: these are lines beginning with `#' and are ignored by the DPC
  2. definitions: these begin with `Define;' and are of the form
    Define;variable-name;value-of-variable-name;
    
    where the value-of-variable-name is used to replace occurrences of the variable-name. For more information on this, see the Define variables page.
  3. instructions: these are of the form
    object(s);parent files;command;
    
    where object(s) is the file(s) we wish to create, the parent files are the files that object requires and command is the unix command carried out to create object - this is frequently a script. (Note that the parent files list should be preceded by the hat symbol (^) if not all the parent files are required to create the object.)

A very basic example of a dependency file could look like:

#--------------------------------------------
# Move data to home directory
#--------------------------------------------
/home/data/raw.dat;/tmp/raw.dat;mv /tmp/raw.dat /home/data/raw.dat;

The first three lines of this file are just comments. The last line defines: an object /home/data/raw.dat: its parent file is /tmp/raw.dat; and it's created by moving raw.dat in /tmp to /home/data. A standard run of the DPC will carry out the move command every time a new version of /tmp/raw.dat is created.

This is an incredibly basic example and full use of the DPC requires other concepts:

Things to do now

Contact

Page navigation