Mercurial > spc_convert
changeset 6:a012d31df380
Made convert.pl work in parallel. Restored files in less than 2 minutes!
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 21 Oct 2011 07:23:22 -0700 |
parents | b6e64e348e47 |
children | 6a2c890c22db |
files | .hgignore convert.pl |
diffstat | 2 files changed, 15 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/.hgignore Fri Oct 21 07:12:40 2011 -0700 1.2 +++ b/.hgignore Fri Oct 21 07:23:22 2011 -0700 1.3 @@ -2,3 +2,5 @@ 1.4 build* 1.5 1.6 test-files* 1.7 + 1.8 +output*
2.1 --- a/convert.pl Fri Oct 21 07:12:40 2011 -0700 2.2 +++ b/convert.pl Fri Oct 21 07:23:22 2011 -0700 2.3 @@ -277,14 +277,20 @@ 2.4 FF.spc); 2.5 2.6 2.7 +`mkdir ./output`; 2.8 + 2.9 for (0..$#targets){ 2.10 2.11 - 2.12 - $command = "./build/spc_convert -s 100" . " -i ./test-files/" . $sources[$_] . 2.13 - " -o ./output/" . $targets[$_]; 2.14 - print "$command\n"; 2.15 - 2.16 - `$command`; 2.17 - 2.18 + my $pid = fork(); 2.19 + 2.20 + if ($pid == 0) { 2.21 + 2.22 + $command = "./build/spc_convert -s 100" . " -i ./test-files/" . 2.23 + $sources[$_] . " -o ./output/" . $targets[$_]; 2.24 + print "$command\n"; 2.25 + 2.26 + `$command`; 2.27 + exit(0); 2.28 + } 2.29 } 2.30