bonjour
c'est encore moi qui demande de l'aide.
je suis en train d'essayer de traduire un script perl en delphi
dans le code suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69 sub CreatePreviewInFolder { my ($path, @garbage) = @_; my @files = (); opendir(DIR, $path) || print FILE "can't read $path\n"; @files = readdir(DIR); closedir(DIR); # my $job; foreach my $file( @files ) { next if (($file eq ".") or ($file eq "..") or($file eq "")); if (-d "$path\\$file") { CreatePreviewInFolder("$path\\$file"); } elsif( $file =~ m/.*\.dc/i ) { my $filepath = lc("$path\\$file"); #$filepath =~ s/\ /\\\ /g; print FILE "test.exe \"$filepath\" -> " . $Types{$filepath} . "\n"; if (exists $Types{$filepath}) { SWITCH: { ($Types{$filepath} == 0) && do { my $job = Win32::Job->new; print FILE "manual mode\n"; (1) $job->spawn(q{..\bin\CreateBmp.exe}, "CreateBmp \"$filepath\" 64 64 64 180 .jpg 1"); $job->run(1000); last SWITCH; }; ($Types{$filepath} == 1) && do { (2) my $job = Win32::Job->new; $job->spawn(q{..\bin\CreateBmp.exe}, "CreateBmp \"$filepath\" 64 64 64 64 .jpg"); $job->run(1000); last SWITCH; }; ($Types{$filepath} == 2) && do { my $job = Win32::Job->new; (3) $job->spawn(q{..\bin\CreateBmp.exe}, "CreateBmp \"$filepath\" 64 64 64 180 .jpg"); $job->run(1000); last SWITCH; }; print FILE "manual mode\n"; my $job = Win32::Job->new; (4) $job->spawn(q{..\bin\CreateBmp.exe}, "CreateBmp \"$filepath\" 64 64 64 180 .jpg 1"); $job->run(1000); } } else { my $job = Win32::Job->new; print FILE "manual mode\n"; (5)$job->spawn(q{..\bin\CreateBmp.exe}, "CreateBmp \"$filepath\" 64 64 64 180 .jpg 1"); $job->run(1000); } { $job = Win32::Job->new; (6)$job->spawn(q{..\bin\IncludeBmp.exe}, "IncludeBmp \"$filepath\" .jpg"); $job->run(1000); } $jpeg = $filepath; $jpeg =~ s/\.dcd/\.jpg/i; $jpeg =~ s/\.dc/\.jpg/i; unlink $jpeg; #print "delete $jpeg"; #print STDOUT "delete $jpeg"; } } }
je compte le nombre de spawn
et j'aimerai savoir quand (equivalent algo)
le 4ème, le 5ème et le 6ème spawn sont éxécuté.
Merci.
Partager