in reply to system() - output folder?

You can use shell I/O redirection:
system("program < input-file > output-file");

Replies are listed 'Best First'.
Re^2: system() - output folder?
by lil_v (Sexton) on Jul 18, 2008 at 16:45 UTC
    my code runs like this:
    my $executable = "C:/Desktop/file.exe"; my $output = "C:/Desktop/Folder"; system("$executable", "Argument") == 0 or die "system failed: $?";
    The program 'file.exe' generates output files on its own, I just need to specify the folder so it outputs it there.

      you can chdir to $output before you do your system call.

      if you save your current workdir (Cwd - getcwd) before that chdir, you can chdir back to the previous workdir afterwards, if necessary.

      update: minor text changes, so it is (hopefully) more precise

        thx...it works great!