Leser: 2
|< 1 2 >| | 17 Einträge, 2 Seiten |
1 2 3 4 5 6 7
# Teilname (nummer) der Datei bestimmen ( Log_pack_'nummer'.txt ) my $pos = $textfield_listing->index(active); my $pack = $packetnumber[$pos]; # den kompletten Pfad in einer Variable abspeichern my $location = "/home/blub/Logfiles/Log_pack_$pack.txt"; system($location);
1
2
3
4
5
6
if ($^O =~ /win/i) {
system( 'notepad', $location );
}
else {
system( 'vi', $location );
}
1 2 3 4 5 6 7 8 9 10
use Thread; my $blub = new Thread \&ssys ; sub ssys() { # den kompletten Pfad in einer Variable abspeichern my $location = "./Logfiles/Log_pack_$packetnumber[$pos].txt"; system ("kate $location"); }
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
#!/usr/bin/perl use Tk; use threads; my @packetnumber; my @hostname; my %pack_status; my $mw = new MainWindow(); my $mframe = $mw->Frame(); my $textfield_listing = $mframe->ScrlListbox(-scrollbars =>"se"); my $button_log = $mframe->Button(-command=>\&viewLog); sub viewLog() { if ($textfield_listing->curselection()) { # make a new Thread for the editor-application my $editor = threads->create("openLogWEA"); } } sub openLogWEA() { # get logfile-location my @tempvar = $textfield_listing->curselection(); my $pos = $tempvar[0]; my $location = "./Logfiles/Log_pack_$packetnumber[$pos].txt"; system("kate $location"); }
|< 1 2 >| | 17 Einträge, 2 Seiten |