Don't run the pp script in the directory of the recording

On widows, running the script in the directory of the recording results
in a filesystem lock on the directory, so that it cannot be deleted.
This commit is contained in:
0xboobface 2018-11-17 13:37:56 +01:00
parent bbe0239ae1
commit ccee14e2ae
2 changed files with 4 additions and 2 deletions

View File

@ -187,7 +187,7 @@ public class LocalRecorder implements Recorder {
Long.toString(download.getStartTime().getEpochSecond())
};
LOG.debug("Running {}", Arrays.toString(args));
Process process = rt.exec(args, OS.getEnvironment(), download.getDirectory());
Process process = rt.exec(args, OS.getEnvironment());
Thread std = new Thread(new StreamRedirectThread(process.getInputStream(), System.out));
std.setName("Process stdout pipe");
std.setDaemon(true);

View File

@ -14,4 +14,6 @@ $date = $epoch.AddSeconds($time)
# print out a theoretical new file name, you could use "rename" here, to rename the file
# or move it somewhere or ...
$newname = "$($model)_$($site)_$($date.toString("yyyyMMdd-HHmm")).ts"
ren $file $newname
Rename-Item -Path $file -NewName $newname
Move-Item -Path "$($dir)\$($newname)" -Destination "c:\Users\username\Desktop\$($newname)"
Remove-Item -Path $dir