How can I get a list of the file handles that my perl application?

How can I get a list of the file handles that my perl application?

am 25.01.2006 18:36:32 von kwopublic-q1

--===============2133918820==
Content-Type: multipart/alternative; boundary="0-53076204-1138210592=:62457"
Content-Transfer-Encoding: 8bit

--0-53076204-1138210592=:62457
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I would like to be able to get a list of the open file handles in my perl application. I want to be able to get the list and print out any properties I can get for the file handle.

Any body have any idea how I can do this?

Thanks in advance,
kwo


--0-53076204-1138210592=:62457
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I would like to be able to get a list of the open file handles in my perl application. I want to be able to get the list and print out any properties I can get for the file handle.
Any body have any idea how I can do this?
 
Thanks in advance,
kwo

--0-53076204-1138210592=:62457--

--===============2133918820==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============2133918820==--

Re: How can I get a list of the file handles that my perl

am 25.01.2006 22:17:10 von Eric Hanchrow

>>>>> "kwo" == writes:

kwo> I would like to be able to get a list of the open file
kwo> handles in my perl application. I want to be able to get the
kwo> list and print out any properties I can get for the file
kwo> handle. Any body have any idea how I can do this?

On Windows, there's a free (but not Free) thingy called "Process
Explorer" from
http://www.sysinternals.com/Utilities/ProcessExplorer.html. Once your
program is running, you can examine Process Explorer and I _think_ you
can get it to display the open handles.
--
Rarely do we find men who willingly engage in hard, solid
thinking. There is an almost universal quest for easy answers
and half-baked solutions. Nothing pains some people more
than having to think.
-- Martin Luther King, Jr.
from "Strength to Love," 1963.

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re : How can I get a list of the file handles that my perl

am 29.01.2006 20:37:45 von kwopublic-q1

--===============1720983784==
Content-Type: multipart/alternative; boundary="0-563885564-1138563465=:90078"
Content-Transfer-Encoding: 8bit

--0-563885564-1138563465=:90078
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I am looking for a way to programmatically get the list of file handles and their properties from inside my application. My application seems to be leaking file handles, so I would like to print them out periodically in an attempt to determine where the leak is. I have done the obvious of matching up the opens and closes but this has not turned anything up.

The debugger is able to print them out, so I figure my app should be able to do it as well.

If anyone has a better idea, I would love to hear it.

Thanks,
kwo


---------------------------------
From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of kwopublic-q1@yahoo.com
Sent: Wednesday, January 25, 2006 9:37 AM
To: activeperl@listserv.ActiveState.com
Subject: How can I get a list of the file handles that my perl application?



I would like to be able to get a list of the open file handles in my perl application. I want to be able to get the list and print out any properties I can get for the file handle.

Any body have any idea how I can do this?

Thanks in advance,
kwo



--0-563885564-1138563465=:90078
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I am looking for a way to programmatically get the list of file handles and their properties from inside my application.  My application seems to be leaking file handles, so I would like to print them out periodically in an attempt to determine where the leak is.  I have done the obvious of matching up the opens and closes but this has not turned anything up.
 
The debugger is able to print them out, so I figure my app should be able to do it as well.
 
If anyone has a better idea, I would love to hear it.
 
Thanks,
kwo


From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-bounces@listserv.ActiveState.com] On Behal
f Of
kwopublic-q1@yahoo.com
Sent: Wednesday, January 25, 2006 9:37 AM
>To:
activeperl@listserv.ActiveState.com
Subject: How can I get a list of the file handles that my perl application?

I would like to be able to get a list of the open file handles in my perl application. I want to be able to get the list and print out any properties I can get for the file handle.
Any body have any idea how I can do this?
 
Thanks in advance,
kwo

--0-563885564-1138563465=:90078--

--===============1720983784==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1720983784==--

Re: How can I get a list of the file handles that my

am 30.01.2006 00:25:48 von Petr Vileta

----- Original Message -----
From:
To:
Sent: Sunday, January 29, 2006 8:37 PM
Subject: Re : How can I get a list of the file handles that my
perlapplication?


> I am looking for a way to programmatically get the list of file handles
> and their properties from inside my application. My application seems to
> be leaking file handles, so I would like to print them out periodically in
> an attempt to determine where the leak is. I have done the obvious of
> matching up the opens and closes but this has not turned anything up.
>
> The debugger is able to print them out, so I figure my app should be able
> to do it as well.
>
The debuger is able to print out file handles because the debuger remeber
all file handle numbers ;-)
If you want to do something similar you must use some like this

open(HANDLE1, ">some_file_or_pipe") or die "Can't open HANDLE1";
....
close(HANDLE1) or die "Can't close HANDLE1";

Instead of "die" you can use "print" if you can to continue program run.

Petr Vileta, Czech republic
(My server reject all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: How can I get a list of the file handles that

am 30.01.2006 02:03:18 von dbecoll

Petr Vileta wrote:


>> I am looking for a way to programmatically get the list of file handles
>>and their properties from inside my application. My application seems to
>>be leaking file handles, so I would like to print them out periodically in
>>an attempt to determine where the leak is. I have done the obvious of
>>matching up the opens and closes but this has not turned anything up.
>>
>> The debugger is able to print them out, so I figure my app should be able
>>to do it as well.
>>
>
> The debuger is able to print out file handles because the debuger remeber
> all file handle numbers ;-)
> If you want to do something similar you must use some like this
>
> open(HANDLE1, ">some_file_or_pipe") or die "Can't open HANDLE1";
> ...
> close(HANDLE1) or die "Can't close HANDLE1";
>
> Instead of "die" you can use "print" if you can to continue program run.

You could also call a subroutine to do your opens and closes and keep
track of them that way. Write it to a log file when debugging is on.

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs