home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
2.x
/
plum2_15_2.lzh
/
module
/
log
/
server.plm
< prev
Wrap
Text File
|
1997-11-16
|
3KB
|
103 lines
# <!-- -*- perl -*-
# $Id: server.plm,v 2.1 1997/11/17 00:12:27 hasegawa Exp $
# copyright (c)1997 pupu_j <hasegawa@agusa.nuie.nagoya-u.ac.jp>
package log_server;
$DIRECTORY = '.';
$FILE = 'logserver';
$HEADER = '%H:%M';
$MODE = umask() ^ 0666;
$_ = 'log_server';
sub server_read {
local($serverno, $line) = @_;
&writelog($'userno[$serverno], $line);
return ($line);
}
sub writelog {
local($userno, $line) = @_;
local($file, $directory, $name, $header, $mode);
$file = &'property($userno, 'file');
$file = $FILE unless defined($file);
$file = &'expand($file);
if ($file =~ /^\//) {
$name = $file;
} else {
$directory = &'property($userno, 'directory');
$directory = $DIRECTORY unless defined($directory);
$directory = &'expand($directory);
$directory .= '/' unless $directory =~ /\/$/;
$name = $directory . $file;
}
$name = &'date($name);
$header = &'property($userno, 'header');
$header = $HEADER unless defined($header);
$header = &'date($header);
if (!-w $name) {
if (!-f $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__
--><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD><TITLE> log/server.plm </TITLE></HEAD><BODY>
$B%*%s%i%$%s%I%-%e%a%s%H(B
<HR><H3> $BL>A0(B </H3>
log/server.plm - $B%5!<%P$+$i$NF~NO$r%m%0$H$7$FJ]B8$9$k(B
<HR><H3> $B@bL@(B </H3>
$B%5!<%P$+$i$NF~NO$r$9$Y$F%m%0$KJ]B8$7$^$9!#(B
<HR><H3> $B%W%m%Q%F%#(B </H3>
<DL>
<DT> log.server.directory $B%G%#%l%/%H%j(B
<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
<DT> log.server.file $B%U%!%$%kL>(B
<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(Blogserver$B!W$H$$$&%U%!%$%k$KJ]B8$7$^$9!#(B
<DT> log.server.header $B$X%C%@(B
<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
<DT> log.server.mode $B%U%!%$%k%b!<%I(B
<DD> $B%m%0$N%U%!%$%k%b!<%I$r;XDj$7$^$9!#(B
</DL>
<HR><H3> $B@_DjNc(B </H3>
<PRE>
+ log/server.plm
log.server.file: server%Y%m%d
</PRE>
$B%5!<%P$+$i$NF~NO$r!V(Bserver%m%d$B!W$KJ]B8$7$^$9!#(B
$B!V(B%Y$B!W!"!V(B%m$B!W!"!V(B%d$B!W$O$=$l$>$l8=:_$NG/!"7n!"F|$KJQ49$5$l$^$9!#(B
</BODY></HTML>