#! /usr/bin/env php workunit->file_ref; $nrefs = $frefs->count(); if (count($infiles) != $nrefs) { die("wrong number of input files; expected $nrefs\n"); } // stage the input files // $fnames = []; foreach ($infiles as $path) { if (!is_file("$path")) { die("no such file: $path\n"); } $fname = basename($path); $fnames[] = $fname; system("cp $path `bin/dir_hier_path $fname`", $ret); if ($ret) { die("Couldn't stage file $path\n"); } } // create the job // $wu_name = sprintf('%s_%d', $appname, time()); $x = ''; if ($input_template) { $x .= " --wu_template $input_template"; } if ($output_template) { $x .= " --result_template $output_template"; } $cmd = sprintf('bin/create_work --appname %s --wu_name %s %s %s', $appname, $wu_name, $x, implode(' ', $fnames) ); if ($verbose) { echo "submit_job: cmd: $cmd\n"; } if (system($cmd, $ret) === false) { die("system($cmd) failed\n"); } if ($ret) { die("Couldn't create job\n"); } echo "Job name: $wu_name\n"; ?>