From: Sean H. <jal...@ho...> - 2001-01-19 01:24:50
|
>Is there a way to catch the STDOUT from using Net::FTP (ie. let $FTPInfo >equal the information (string) from Net::FTP) and place it in > >$SB = $Window->AddStatusBar(-text => $FTPInfo); $SB->Text($FTPInfo); should do the trick. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com |
From: <Kev...@Al...> - 2001-01-19 14:11:51
|
Erick, I'm convinced that there must be a simple way to do this but, I've tried everything I can think of but haven't found it yet. The PerlDocs seemed to suggest using Forks, Pipes and/or IPC, but this will probably be abit more complicated than you want. You could redirect STDOUT (and/or STDERR) to a file while you do the ftp stuff, and read the contents of the file back once you've finished. Doesn't seem right to have to do it that way though. Kev. er...@e-... on 19/01/2001 06:01:40 To: per...@li... @ INTERNET cc: Subject: [perl-win32-gui-users] Net::FTP with AddStatusBar() I guess my question was really how to catch it from Net::FTP. For example, catch the STDOUT so that I could have $FTPInfo = "331 User name okay, need password." > >Is there a way to catch the STDOUT from using Net::FTP (ie. let $FTPInfo > >equal the information (string) from Net::FTP) and place it in > > > >$SB = $Window->AddStatusBar(-text => $FTPInfo); > > $SB->Text($FTPInfo); > > should do the trick. erick _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: <Chr...@ti...> - 2001-01-19 19:12:57
|
try tieing STDOUT to a scalar with IO:Scalar. Here's an example (untested) that may point you in the right direction: use IO::Scalar; my $FTPInfo; tie *STDOUT, 'IO::Scalar', \$FTPInfo; print "line 1\nline 2\n", "line 3\n"; $SB->Text($FTPInfo); HTH, tcl...@we... -----Original Message----- From: Kev...@Al... [mailto:Kev...@Al...] Sent: Friday, January 19, 2001 8:08 AM To: er...@e-... Cc: per...@li... Subject: Re: [perl-win32-gui-users] Net::FTP with AddStatusBar() Erick, I'm convinced that there must be a simple way to do this but, I've tried everything I can think of but haven't found it yet. The PerlDocs seemed to suggest using Forks, Pipes and/or IPC, but this will probably be abit more complicated than you want. You could redirect STDOUT (and/or STDERR) to a file while you do the ftp stuff, and read the contents of the file back once you've finished. Doesn't seem right to have to do it that way though. Kev. er...@e-... on 19/01/2001 06:01:40 To: per...@li... @ INTERNET cc: Subject: [perl-win32-gui-users] Net::FTP with AddStatusBar() I guess my question was really how to catch it from Net::FTP. For example, catch the STDOUT so that I could have $FTPInfo = "331 User name okay, need password." > >Is there a way to catch the STDOUT from using Net::FTP (ie. let $FTPInfo > >equal the information (string) from Net::FTP) and place it in > > > >$SB = $Window->AddStatusBar(-text => $FTPInfo); > > $SB->Text($FTPInfo); > > should do the trick. erick _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: Erick J. B. <er...@e-...> - 2001-01-19 21:48:14
|
The program stalls when it tries to read from the STDOUT. I was looking at the docs, Net::Cmd, and there is a ion ->message(), however, it stalls there as well, waiting. ->message() returns the text message returned from the last command . Don't get it? |
From: Erick J. B. <er...@e-...> - 2001-01-19 21:53:37
|
sorry ->message() is method |
From: <Chr...@ti...> - 2001-01-19 21:56:44
|
I think It may be time for you to start submitting some code to us.. It's a lot easier to give advice when you see a whole block of code... -----Original Message----- From: Erick J. Bourgeois [mailto:er...@e-...] Sent: Friday, January 19, 2001 3:46 PM To: per...@li... Subject: [perl-win32-gui-users] Net::FTP with AddStatusBar() The program stalls when it tries to read from the STDOUT. I was looking at the docs, Net::Cmd, and there is a ion ->message(), however, it stalls there as well, waiting. ->message() returns the text message returned from the last command . Don't get it? _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: Erick J. B. <er...@e-...> - 2001-01-19 22:18:26
|
Sorry, here is the sub for connecting to an FTP server sub CmdConnect_Click { my $FTPInfo; $Textbox->Text("Connecting to $Host"); if ($ftp = Net::FTP->new($Host, Timeout => 45, Debug => 1)) { $FTPInfo = Net::Cmd::message(); #Problem lies here, it just stops $StatusBar->Text("$FTPInfo"); if ($ftp->login($User, $Pass)) { $StatusBar->Text("Logged on to $Host ..."); } else { $StatusBar->Text("Connect not authenticated."); } } else { $StatusBar->Text("Can't connect to $Host"); } } |
From: <Chr...@ti...> - 2001-01-19 22:53:54
|
Try $FTPInfo = $ftp->message(); -----Original Message----- From: Erick J. Bourgeois [mailto:er...@e-...] Sent: Friday, January 19, 2001 4:15 PM To: per...@li... Subject: [perl-win32-gui-users] Net::FTP with AddStatusBar() Sorry, here is the sub for connecting to an FTP server sub CmdConnect_Click { my $FTPInfo; $Textbox->Text("Connecting to $Host"); if ($ftp = Net::FTP->new($Host, Timeout => 45, Debug => 1)) { $FTPInfo = Net::Cmd::message(); #Problem lies here, it just stops $StatusBar->Text("$FTPInfo"); if ($ftp->login($User, $Pass)) { $StatusBar->Text("Logged on to $Host ..."); } else { $StatusBar->Text("Connect not authenticated."); } } else { $StatusBar->Text("Can't connect to $Host"); } } _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: Erick J. B. <er...@e-...> - 2001-01-19 06:03:39
|
I guess my question was really how to catch it from Net::FTP. For example, catch the STDOUT so that I could have $FTPInfo = "331 User name okay, need password." > >Is there a way to catch the STDOUT from using Net::FTP (ie. let $FTPInfo > >equal the information (string) from Net::FTP) and place it in > > > >$SB = $Window->AddStatusBar(-text => $FTPInfo); > > $SB->Text($FTPInfo); > > should do the trick. erick |