home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
WinFiles.com 1998 June
/
WF0698_3.ISO
/
servers-websrv
/
websuite.exe
/
LOGLIST.AP_
/
LOGLIST.AP
Wrap
Text File
|
1998-04-01
|
2KB
|
70 lines
<[
// SmartDesk's Personal Web Server - Log List
// (c) 1997-98 SmartDesk, Inc., All Rights Reserved
// Main Routine
_apGenerate( )
session = new( "session", param( 1 ), param( 2 ) )
if ( ! session.secure( "Server.Logs.Access" ) )
return( 0 )
end
webLogCacheFlush( session.websrvr )
path = webServerBaseDir( session.websrvr )
filename = fileFixPath( path + '\sdwebsrv.log' )
if ( ! fileExists( filename ) )
session.error( "No log data available, try flushing the log data cache from the system area of the mini-console..." )
return(0)
end
]>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!-- SmartDesk Active Page, www.smartdesk.com -->
<HTML>
<HEAD>
<TITLE>Server Log List</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000">
<pre>
<[
hfile = fopen( filename, 0 )
if ( hfile < 1 )
session.error( "Unable to open " + filename + " file." )
return( 0 )
end
buf_size = 50000
len = flen( hfile )
if ( len < buf_size )
fclose( hfile )
data = fileReadAscii( filename )
else
fseek( hfile, -1 * buf_size, 2 )
data = fread( hfile, buf_size )
fclose( hfile )
end
! "<b>Log File: " + lower( filename )
! "Log Size: " + strcommas( "" + len ) + " bytes</b><br><br>"
data = strswap( data, "\n", "" )
cnt = chrcount( "\r", data )
for ( i=cnt; i>0; i-- )
! strextract( data, "\r", i )
end
if ( len > buf_size )
! "...<br>"
end
]>
</pre>
</BODY>
</HTML>