08-08-2001
File Handles
Hi,
perhaps you can answer my question.....
How can I check, how many file handles are used and how can i increase the value for maximum file handles???
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all
I try to execute SSH commands on several hosts in a while-loop.
There seems to be a problem with file-handle, first cycle works correct but no other one will follow due to the while condition is false even that there are many more host entries (lines) in all_hosts.dat.
... (3 Replies)
Discussion started by: DaveCutler
3 Replies
2. Shell Programming and Scripting
Hello,
I have a program which opens a pipe for communication using file handle and forks 5 child processes.
@waitlist = (1,2,3,4,5);
foreach $item (@waitlist) {
pipe *{$item},RETHAND;
unless ($pid = fork()) {
# Child process
print RETHAND... (1 Reply)
Discussion started by: the_learner
1 Replies
3. Shell Programming and Scripting
See attached file that includes code, input and output.
I am processing a colon delimited input file and building a ":" (colon) delimited output file.
My printf statement prints contents of each of 20 variables and puts them into a record file. I am pushing out approximately 120 records.
The... (2 Replies)
Discussion started by: Skyybugg
2 Replies
4. Shell Programming and Scripting
We have a process that is running out of file handles. Is there some command line way to determine this that we can include into a cron script?
Please let me know
JAK (3 Replies)
Discussion started by: jakSun8
3 Replies
5. UNIX for Advanced & Expert Users
Hi Thinkers,
On AIX 5.3, we have a monitor program that reads the log file and searching for a certain string pattern that we define(say "transactionException"), if it sees it then it will raise an alert by sending an email.
Because the log file XXX.log is rolling into XXX.log.0, XXX.log.1,... (2 Replies)
Discussion started by: TheGunMan
2 Replies
6. UNIX for Advanced & Expert Users
I'm using Sendmail 8.13.8 on a CentOS 5.5 vServer (Virtuozzo).
I'm using a loop in PHP to send a lot of HTML-mails via sendmail. Each mail is a mail with individual statistics for our users, so its not mass mailing, bcc is not an option.
It all works fine, but when I take a closer look there... (2 Replies)
Discussion started by: ZX81
2 Replies
7. UNIX for Dummies Questions & Answers
This is a strange one.
We have an issue where our system is leaking SCTP file handles. There are people working on this and in the mean time we have a monitoring script that alarms when we need to perform actions to manually clear them. For testing purposes I want to write a script that... (0 Replies)
Discussion started by: RECrerar
0 Replies
8. Shell Programming and Scripting
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies
9. Linux
Hi everyone, I have a question about the process management, and deep level system functionality of system calls between SystemD and SystemV? Does SystemD use the same system calls (fork(), exec(), bind() etc...) as SystemV? or Vice Versa? If they both use the same or very very similar sys... (2 Replies)
Discussion started by: Lost in Cyberia
2 Replies
10. Shell Programming and Scripting
Shell script logic
Hi
I have 2 input files like with file 1 content as (file1)
"BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt
File 2 contents as fle(2)
"BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt
I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
LEARN ABOUT DEBIAN
io::select
IO::Select(3perl) Perl Programmers Reference Guide IO::Select(3perl)
NAME
IO::Select - OO interface to the select system call
SYNOPSIS
use IO::Select;
$s = IO::Select->new();
$s->add(*STDIN);
$s->add($some_handle);
@ready = $s->can_read($timeout);
@ready = IO::Select->new(@handles)->can_read(0);
DESCRIPTION
The "IO::Select" package implements an object approach to the system "select" function call. It allows the user to see what IO handles, see
IO::Handle, are ready for reading, writing or have an exception pending.
CONSTRUCTOR
new ( [ HANDLES ] )
The constructor creates a new object and optionally initialises it with a set of handles.
METHODS
add ( HANDLES )
Add the list of handles to the "IO::Select" object. It is these values that will be returned when an event occurs. "IO::Select" keeps
these values in a cache which is indexed by the "fileno" of the handle, so if more than one handle with the same "fileno" is specified
then only the last one is cached.
Each handle can be an "IO::Handle" object, an integer or an array reference where the first element is an "IO::Handle" or an integer.
remove ( HANDLES )
Remove all the given handles from the object. This method also works by the "fileno" of the handles. So the exact handles that were
added need not be passed, just handles that have an equivalent "fileno"
exists ( HANDLE )
Returns a true value (actually the handle itself) if it is present. Returns undef otherwise.
handles
Return an array of all registered handles.
can_read ( [ TIMEOUT ] )
Return an array of handles that are ready for reading. "TIMEOUT" is the maximum amount of time to wait before returning an empty list,
in seconds, possibly fractional. If "TIMEOUT" is not given and any handles are registered then the call will block.
can_write ( [ TIMEOUT ] )
Same as "can_read" except check for handles that can be written to.
has_exception ( [ TIMEOUT ] )
Same as "can_read" except check for handles that have an exception condition, for example pending out-of-band data.
count ()
Returns the number of handles that the object will check for when one of the "can_" methods is called or the object is passed to the
"select" static method.
bits()
Return the bit string suitable as argument to the core select() call.
select ( READ, WRITE, EXCEPTION [, TIMEOUT ] )
"select" is a static method, that is you call it with the package name like "new". "READ", "WRITE" and "EXCEPTION" are either "undef"
or "IO::Select" objects. "TIMEOUT" is optional and has the same effect as for the core select call.
The result will be an array of 3 elements, each a reference to an array which will hold the handles that are ready for reading, writing
and have exceptions respectively. Upon error an empty list is returned.
EXAMPLE
Here is a short example which shows how "IO::Select" could be used to write a server which communicates with several sockets while also
listening for more connections on a listen socket
use IO::Select;
use IO::Socket;
$lsn = IO::Socket::INET->new(Listen => 1, LocalPort => 8080);
$sel = IO::Select->new( $lsn );
while(@ready = $sel->can_read) {
foreach $fh (@ready) {
if($fh == $lsn) {
# Create a new socket
$new = $lsn->accept;
$sel->add($new);
}
else {
# Process socket
# Maybe we have finished with the socket
$sel->remove($fh);
$fh->close;
}
}
}
AUTHOR
Graham Barr. Currently maintained by the Perl Porters. Please report all bugs to <perl5-porters@perl.org>.
COPYRIGHT
Copyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights reserved. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
perl v5.14.2 2011-09-19 IO::Select(3perl)