c11v11
asked on
Is there a file descriptor created for logfile using by logmsg within Perl script
We have a log file which is updated by one Perl script using logmsg. But I find nothing when I am using lsof|grep logfile to try to find out the process id. Actually I already know which process but I also did not find this logfile descriptor in /proc/processid/fd. Why? What is the right way to find out this process ?
How is logmsg defined?
ASKER
sub logmsg {
my ($msg) = @_;
my $LOG = new IO::File::fcntl("$logFile" ,'a','lock _ex') or warn "$!";
my $DateTime = strftime "%b %e %Y %T", localtime;
if ($LOG) {
print $LOG "$DateTime,$msg";
print "$DateTime,$msg" if (! $daemon);
close $LOG;
}
}
How can I get the $LOG value? Is this the value for file descriptor?
my ($msg) = @_;
my $LOG = new IO::File::fcntl("$logFile"
my $DateTime = strftime "%b %e %Y %T", localtime;
if ($LOG) {
print $LOG "$DateTime,$msg";
print "$DateTime,$msg" if (! $daemon);
close $LOG;
}
}
How can I get the $LOG value? Is this the value for file descriptor?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I have recommended this question be closed as follows:
Accept: bigbed (http:#a40108719)
If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
suhasbharadwaj
Experts-Exchange Cleanup Volunteer
I have recommended this question be closed as follows:
Accept: bigbed (http:#a40108719)
If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
suhasbharadwaj
Experts-Exchange Cleanup Volunteer