- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- PERL & UNIX : critical race?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 10:55 PM
05-06-2004 10:55 PM
please see the following branch of a PERL program:
$pid_open3 = open3($in, $out, "", "/usr/contrib/bin/gzip -c $currFile");
my $hnd = RemoteWriteFromArray($host, "${currRemoteFile}.gz", $user, $group, $mode, undef, $system, $instance, "NOBUFFER");
while (<$out>) {
print $hnd $_;
}
The expected behaviour is:
run a gzip by the open3
recevives the output of gzip by $out
write to the remote socket the output of gzip
Unfortunately sometimes it doesn't work: the gzip continues producing output but nothing is sento to the remote socket
Maybe the print fails because the $hnd isn't a valida handler anymore or something else?
maybe the gzip output isn't catched anymore by the script?
thanks
Enrico
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 11:06 PM
05-06-2004 11:06 PM
Re: PERL & UNIX : critical race?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 11:40 PM
05-06-2004 11:40 PM
Re: PERL & UNIX : critical race?
For instance for a file of 69478 bytes only 44563 are written .. this is almost systematic when the script runs free; it doesn't happen when I run the PERL debugger :-(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2004 12:42 AM
05-07-2004 12:42 AM
Solutioncould it be that your code fell victim to Unix buffering of the gzip command?
Have a look at the POD of IPC::Open3 (i.e. perldoc IPC::Open3) where this issue is mentioned.
In the perlipc POD (perldoc perlipc) position your pager's cursor to "/Unix buffering".
There you will find a hack that uses pseudo tty to overcome this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2004 03:22 AM
05-07-2004 03:22 AM
Re: PERL & UNIX : critical race?
I tried to change my code but now I get this error ....
my($out) = gensym();
$out = open_proc('/usr/contrib/bin/gzip -c $currFile');
DB<7> n
Remotizer doesn't contain an __DATA__ token at /alcatel/Kernel/lib/lib_perl/Remotizer.pm line 1440
Carp::croak('Remotizer doesn\'t contain an __DATA__ token') called at /usr/local/lib/perl5/5.00503/SelfLoader.pm line 45
SelfLoader::_load_stubs('SelfLoader', undef) called at /usr/local/lib/perl5/5.00503/SelfLoader.pm line 19
SelfLoader::AUTOLOAD('/usr/contrib/bin/gzip -c $currFile') called at /alcatel/Kernel/lib/lib_perl/Remotizer.pm line 1440
Remotizer::RemoteCopy('/tmp/y', 'h3grm2:/tmp/db.sav', 'snml', 'dba', 0777, 'compress') called at ./xxx line 83
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
DB<7>