Zipfiles in Developer Help
|
|
Code:
proc/Log(l,a=1) if( !log ) log = file( LOG_NAME ) if( length(log) >= 50 ) var/zipfile/z = new("log.zip") z.Import("[LOG_NAME]","//log_[z.contents.len].txt") z.Close() fdel( LOG_NAME ) log = file( LOG_NAME )
l = "\[[time2text(world.realtime)]] [l]" log << l
if( DREAMDAEMON ) if( _host.len ) for( var/c in _host ) if(a) c << "[l]"
if(a) world.log << "[l]"
|
Problem description:
The piece of code is meant to automatically archive log files that grow over a certain size and put them in a zip file (using dantom.zipfile). I've been testing it and so far it seems to silently fail upon importing any files other than the first log into the zipfile. Any ideas?
|