Raised This Month: $ Target: $400
 0% 

log_to_file and directory creating not work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
James
Senior Member
Join Date: Dec 2004
Old 10-30-2006 , 07:15   log_to_file and directory creating not work
Reply With Quote #1

Hello, i am using Linux HLDS. I want to log my plugins to dynamically created directories like

logs/2006-10
logs/2006-11
logs/2006-12

but function log_to_file can create ONLY file.. Does anybody know ho create this dynamically? I must use this
Code:
...
get_time("/addons/amxmodx/logs/CM/%Y-%m-%d.log", filename, 99)	
...
log_to_file(filename, logline)
because
Code:
get_time("/addons/amxmodx/logs/CM/%Y-%m/%d.log", filename, 99)	
log_to_file(filename, logline)
doesnt work. Directory xx-xx isnt created.

Please, help me..

Last edited by James; 10-30-2006 at 07:18.
James is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-30-2006 , 09:18   Re: log_to_file and directory creating not work
Reply With Quote #2

Code:
	if(!dir_exists(g_Dir))
		mkdir(g_Dir)
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
James
Senior Member
Join Date: Dec 2004
Old 10-30-2006 , 18:22   Re: log_to_file and directory creating not work
Reply With Quote #3

thanks it works. Little laborious when check more than one directory, but works
James is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-31-2006 , 02:30   Re: log_to_file and directory creating not work
Reply With Quote #4

Recursive functions are excellent to walk through a directory structure.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode