private function HandleDBFFile($OldFile, $NewFile, $Fields, $SkipLines, $TrimData) { // Rename source file to .dbf for conversion program, output file will end in csv $TempOldName = $OldFile . ".dbf"; if (rename($OldFile, $TempOldName) === FALSE) { trigger_error("Can't rename {$OldFile} to {$TempOldName}", E_USER_ERROR); } $command = Config::getPerl() . " " . Config::Dbf2Csv . " " . $TempOldName; echo "Executing command {$command}\n"; $output = exec($command, $op, $return); if ($return != 0) { trigger_error("Could not convert dbf file via {$command}", E_USER_ERROR); } if (rename($TempOldName, $OldFile) === FALSE) { trigger_error("Can't rename {$TempOldName} to {$OldFile}", E_USER_ERROR); } $OldFile = $OldFile . ".csv"; $this->FilesToPurge[$OldFile] = NULL; $this->HandleCSVFile($OldFile, $NewFile, $Fields, $SkipLines, $TrimData); return $NewFile; }