#! /usr/bin/env php workunit->file_ref; $nrefs = $frefs->count(); if ($argc-2 != $nrefs) { die("wrong number of input files; expected $nrefs\n"); } // stage the input files // $file_list = []; for ($i=2; $i<$argc; $i++){ $fname = $argv[2]; if (!is_file($fname)) { die("no such file: $fname\n"); } system("cp $fname `bin/dir_hier_path $fname`", $ret); if ($ret) { die("Couldn't stage file\n"); } $file_list[] = $fname; } // create the job // $wu_name = sprintf('%s_%d', $appname, time()); $cmd = sprintf('bin/create_work --appname %s --wu_name %s %s', $appname, $wu_name, implode(' ', $file_list) ); system($cmd, $ret); if ($ret) { die("Couldn't create job\n"); } echo "Job name: $wu_name\n"; ?>