This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Autocreation of Logdirs

Old posts that have not been replied to for several years.
Locked
o
ok

Autocreation of Logdirs

Post by ok »

Hello,

I'm looking for a script/setting which makes the eggdrop create the logdirs itsself. So if I add 'logfile #chan <setting> "logs/<channel>/<chan>.log' the directory <channel> should be created automatically.

There should be several ways solving that problem but maybe a simple solution already exists..

Tanks for help,
ok
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: Autocreation of Logdirs

Post by user »

This code is not tested, so don't complain if it doesn't work ;P

Code: Select all

if {![string len [info procs logfile]] && [string len [info commands logfile]]} {
	rename logfile _logfile
	proc logfile {args} {
		if {[llength $args]==3} {
			file mkdir [file dirname [lindex $args 2]]
		}
		eval _logfile $args
	}
}
EDIT: the dir check i had initially made no sense so I removed it.
Locked