home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
2.x
/
plum2_28_2.lzh
/
module
/
log
/
client.plm
< prev
next >
Wrap
Text File
|
1998-10-15
|
3KB
|
108 lines
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- $_ if 0; # -*- perl -*-
# $Id: client.plm,v 2.6 1998/05/22 10:41:14 hasegawa Exp $
# copyright (c)1997-1998 pupu_j <hasegawa@agusa.nuie.nagoya-u.ac.jp>
package log_client;
$DIRECTORY = '.';
$FILE = 'logclient';
$HEADER = '%H:%M';
$MODE = umask() ^ 0666;
$_ = 'log_client';
sub client_read {
local($clientno, $line) = @_;
&writelog($'userno[$clientno], $line);
return ($line);
}
sub writelog {
local($userno, $line) = @_;
local($file, $dir, $name, $header, $mode);
$file = &'expand(&'property($userno, 'file') || $FILE);
if ($file =~ /^\//) {
$name = $file;
} else {
$dir = &'expand(&'property($userno, 'directory') || $DIRECTORY);
$name = "$dir/$file";
}
$name = &'date($name);
$header = &'property($userno, 'header');
$header = $HEADER unless defined($header);
$header = &'date($header);
if (!-w $name) {
if (!-e $name && open(FILE, ">$name")) {
close(FILE);
}
$mode = &'property($userno, 'mode');
if (defined($mode)) {
$mode = oct($mode) | 0200;
} else {
$mode = $MODE | 0200;
}
chmod($mode, $name) if -f $name;
}
if (open(FILE, ">>$name")) {
select((select(FILE), $| = 1)[0]);
print FILE $header, ' ', $line, "\n";
close(FILE);
}
}
__END__
--><HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-2022-JP">
<LINK REV="made" HREF="mailto:hasegawa@agusa.nuie.nagoya-u.ac.jp">
<TITLE>log/client.plm</TITLE></HEAD><BODY>
$B%*%s%i%$%s%I%-%e%a%s%H(B
<HR><H3>$BL>A0(B</H3>
log/client.plm - $B%/%i%$%"%s%H$+$i$NF~NO$r%m%0$H$7$FJ]B8$9$k(B
<HR><H3>$B@bL@(B</H3>
$B%/%i%$%"%s%H$+$iF~NO$r$9$Y$F%m%0$KJ]B8$7$^$9!#(B
<HR><H3>$B%W%m%Q%F%#(B</H3>
<DL>
<DT> log.client.directory $B%G%#%l%/%H%j(B
</DT>
<DD> $B%m%0$rJ]B8$9$k%G%#%l%/%H%j$r;XDj$7$^$9!#(B
$B%G%U%)%k%H$G$O%+%l%s%H%G%#%l%/%H%j$KJ]B8$7$^$9!#(B
</DD>
<DT> log.client.file $B%U%!%$%kL>(B
</DT>
<DD> $B%m%0$N%U%!%$%kL>$r;XDj$7$^$9!#(B
%$B$G$O$8$^$kJ8;z$,$"$k$H!"BP1~$9$kF|IU$KJQ49$5$l$^$9!#(B
$B%G%U%)%k%H$G$O!V(Blogclient$B!W$H$$$&%U%!%$%k$KJ]B8$7$^$9!#(B
</DD>
<DT> log.client.header $B$X%C%@(B
</DT>
<DD> $B%m%0$K=PNO$9$k;~9o$N%U%)!<%^%C%H$r;XDj$7$^$9!#(B
%$B$G$O$8$^$kJ8;z$,$"$k$H!"BP1~$9$k;~4V$KJQ49$5$l$^$9!#(B
</DD>
<DT> log.client.mode $B%U%!%$%k%b!<%I(B
</DT>
<DD> $B%m%0$N%U%!%$%k%b!<%I$r;XDj$7$^$9!#(B
</DD>
</DL>
<HR><H3>$B@_DjNc(B</H3>
<PRE>
+ log/client.plm
log.client.file: client%m%d
</PRE>
$B%/%i%$%"%s%H$+$i$NF~NO$r!V(Bclient%m%d$B!W$KJ]B8$7$^$9!#(B
$B!V(B%m$B!W$H!V(B%d$B!W$O$=$l$>$l8=:_$N7n$HF|$KJQ49$5$l$^$9!#(B
</BODY></HTML>