AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   log_to_file and directory creating not work (https://forums.alliedmods.net/showthread.php?t=46627)

James 10-30-2006 07:15

log_to_file and directory creating not work
 
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..

Emp` 10-30-2006 09:18

Re: log_to_file and directory creating not work
 
Code:

        if(!dir_exists(g_Dir))
                mkdir(g_Dir)


James 10-30-2006 18:22

Re: log_to_file and directory creating not work
 
thanks it works. Little laborious when check more than one directory, but works

MaximusBrood 10-31-2006 02:30

Re: log_to_file and directory creating not work
 
Recursive functions are excellent to walk through a directory structure.


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

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