-#else
- // Push directory path if necessary.
- // PS file should go where the source file is unless it's a
- // read-only directory in which case we write it to tmpdir.
- // All temporary files go in tmpdir (like spool files).
- string path = OnlyPath(buffer->fileName());
- if ((pp.target != PrinterParams::FILE
- && lyxrc.use_tempdir)
- || (IsDirWriteable(path) < 1)) {
- path = buffer->tmppath;
- }
- Path p(path);
-
- // there are three cases here:
- // 1. we print to a file
- // 2. we print direct to a printer
- // 3. we print using a spool command (print to file first)
- switch (pp.target) {
- case PrinterParams::PRINTER:
- if (!lyxrc.print_spool_command.empty()) {
- // case 3
- command += lyxrc.print_to_file
- + QuoteName(pp.file_name);
- string command2 = lyxrc.print_spool_command
- + ' ';
- if (!pp.printer_name.empty()) {
- command2 += lyxrc.print_spool_printerprefix
- + pp.printer_name;
- }
- // First run dvips.
- // If successful, then spool command
- if (result = RunScript(buffer, true, command)) {
- result = RunScript(buffer, false,
- command2,
- QuoteName(pp.file_name));
- }
- } else {
- // case 2
- result = RunScript(buffer, false, command);
- }
- break;
-
- case PrinterParams::FILE:
- // case 1
- command += lyxrc.print_to_file
- + QuoteName(MakeAbsPath(pp.file_name, path));
- result = RunScript(buffer, false, command);
- break;
- }
- return result;
-#endif