// Path: src/org/svetovid/io/SvetovidProcess.java
// public class SvetovidProcess {
// 
//     public final Process process;
//     public final SvetovidWriter in;
//     public final SvetovidReader out;
//     public final SvetovidReader err;
// 
//     public SvetovidProcess(Process process) {
//         this.process = process;
//         in = new DefaultSvetovidWriter(process.getOutputStream());
//         out = new DefaultSvetovidReader(process.getInputStream());
//         err = new DefaultSvetovidReader(process.getErrorStream());
//     }
// 
//     public String toString() {
//         return process.toString();
//     }
// 
//     public int waitFor() throws InterruptedException {
//         return process.waitFor();
//     }
// 
//     public boolean isAlive() {
//         try {
//             process.exitValue();
//             return false;
//         } catch(IllegalThreadStateException e) {
//             return true;
//         }
//     }
// 
//     public int exitValue() {
//         return process.exitValue();
//     }
// 
//     public void destroy() {
//         process.destroy();
//     }
// }


import java.io.IOException;
import java.lang.ProcessBuilder.Redirect;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.svetovid.io.SvetovidProcess;

    public SvetovidProcessBuilder redirectOutput(Path file) {
        builder.redirectOutput(file.toFile());
        return this;
    }

    public SvetovidProcessBuilder redirectError(Path file) {
        builder.redirectError(file.toFile());
        return this;
    }

    public SvetovidProcessBuilder inheritIO() {
        builder.inheritIO();
        return this;
    }

    public boolean redirectErrorStream() {
        return builder.redirectErrorStream();
    }

    public SvetovidProcessBuilder redirectErrorStream(boolean redirectErrorStream) {
        builder.redirectErrorStream(redirectErrorStream);
        return this;
    }

    public List<String> effectiveCommand() {
        List<String> cmd = builder.command();
        cmd = new ArrayList<>(cmd);
        return cmd;
    }


// Path: src/org/svetovid/io/SvetovidProcess.java
// public class SvetovidProcess {
// 
//     public final Process process;
//     public final SvetovidWriter in;
//     public final SvetovidReader out;
//     public final SvetovidReader err;
// 
//     public SvetovidProcess(Process process) {
//         this.process = process;
//         in = new DefaultSvetovidWriter(process.getOutputStream());
//         out = new DefaultSvetovidReader(process.getInputStream());
//         err = new DefaultSvetovidReader(process.getErrorStream());
//     }
// 
//     public String toString() {
//         return process.toString();
//     }
// 
//     public int waitFor() throws InterruptedException {
//         return process.waitFor();
//     }
// 
//     public boolean isAlive() {
//         try {
//             process.exitValue();
//             return false;
//         } catch(IllegalThreadStateException e) {
//             return true;
//         }
//     }
// 
//     public int exitValue() {
//         return process.exitValue();
//     }
// 
//     public void destroy() {
//         process.destroy();
//     }
// }


// Path: src/org/svetovid/run/SvetovidProcessBuilder.java
import java.io.IOException;
import java.lang.ProcessBuilder.Redirect;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.svetovid.io.SvetovidProcess;

    public SvetovidProcessBuilder redirectOutput(Path file) {
        builder.redirectOutput(file.toFile());
        return this;
    }

    public SvetovidProcessBuilder redirectError(Path file) {
        builder.redirectError(file.toFile());
        return this;
    }

    public SvetovidProcessBuilder inheritIO() {
        builder.inheritIO();
        return this;
    }

    public boolean redirectErrorStream() {
        return builder.redirectErrorStream();
    }

    public SvetovidProcessBuilder redirectErrorStream(boolean redirectErrorStream) {
        builder.redirectErrorStream(redirectErrorStream);
        return this;
    }

    public List<String> effectiveCommand() {
        List<String> cmd = builder.command();
        cmd = new ArrayList<>(cmd);
        return cmd;
    }


    public SvetovidProcess start() throws IOException {
