mIRC Home    About    Download    Register    News    Help

Print Thread
"Unable to open log file" #154108 27/07/06 04:36 PM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
hi there

I'm writing a script which doesn't saves/supports logs. By enableing this script, $logdir will be deleted.
So the problem is: as soon as $logdir doesen't exist, i'll get notified by * Unable to open log file 'logs\Tw33ty.20060701.log' in any querywindow that I get or open.

Is there a way to screen this off or sumth?

Last edited by Tw33ty; 27/07/06 04:37 PM.
Re: "Unable to open log file" #154109 27/07/06 10:00 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I don't think you can literally delete the log directory without running into problems, as that is the same location where your buffer(s) are stored, as well as your logs. Now from the log perspective, you can go to mIRC Options - IRC - Logging
then set Automatically Log: None (this is at the top of the drop down box)
then ensure that none of the check boxes are checked.

I think that'll stop the problem you're encountering, however, as I said, the fact that your buffers are stored in that same directory, means that the directory must be present.

If I may enquire, why are you having the log directory deleted in your script? Just because the directory exists doesn't mean you have to use it.

Re: "Unable to open log file" #154110 27/07/06 10:19 PM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
I've written a script with more options that also saves all logs, just not into $logdir (log-directory) but it opens an own window. I ain't really looking for an manually funktion that allows you to disable this problem ... cuz it just don't make no sence. The sence is to impart my script.
I deleted log-directory because of spacewasting cuz I don't wanna get all those logs twice.

I've already writen more than 530 lines and I don't wanna start from scratch or even to delete the script becuz of this problem smirk
Any ideas?

Re: "Unable to open log file" #154111 27/07/06 10:28 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Just turn off the auto-logging, as I showed in my previous post, then the logs will only be written via your script.

Re: "Unable to open log file" #154112 27/07/06 11:49 PM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
Sorry if I missunderstood but "Options - IRC - Logging" only tunrs off the logging for my OWN mIRC.
So if I wanna send this script to any1 else. The user also has to select this option first, before he can use this script. It just could be fine if he doesn't need to.

And a diractly command such as /log off ALL or sumth doesn't exist. The command /log off <window> does exist but it only disables the logging for the chosen window.
I've already been trying it on an on-text-event but the fist message of the user will still remain.
So just another question (maybe out of topic) ... is there a way to delete ALL the files which are in a window without to delete the window itself?

Re: "Unable to open log file" #154113 28/07/06 12:03 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Here's a quick little code that I wrote for another topic, but needed the same thing. A way to turn off the logging for all windows
Code:
 alias logoff {
  var %a = 1, %b = $window(*,0)
  while %a &lt;= %b {
    log off $window(*,%a)
    inc %a
  }
}
 


As to deleting the files in a window, I'm confused, since windows (to my knowledge) don't contain files.

Re: "Unable to open log file" #154114 28/07/06 02:18 AM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
Thanx for the code but anyhow it seems like it won't work. Btw. your code would only work by active windows.
But what I'm looking for is a deactivation for all windows.

For example:
on *:join:#:{ logoff }
... will still let remain:

Session Start: Fri Jul 28 04:13:34 2006
[04:13:34] *** Now talking in #test
Session Close: Fri Jul 28 04:13:35 2006

I'm not sure, but maybe the same kinda code would work by /remove ... dunno

So, anyway ... thereby I rather thought about working with CMD. Even via CMD I could open or also delete a window. So I'm just wondering why it won't work by deleting all the files which are inside a window. Cuz the same command won't just delete windows, it could delete all the filetypes. So I guess, I just need an alias or a variable that could mark all the files in the log-directory. Via this I could easily let 'em remove - this could be a way I think?!

Re: "Unable to open log file" #154115 28/07/06 07:35 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Just dont delete the logdir, what bussiness is it of your script as to the other settings of SOMEONE ELSES mirc, maybe the person wants to run using both your logging and mircs, not to mention that other scripts also use $logdir, so there all gonna go crap faced as well if u delete the folder.

Re: "Unable to open log file" #154116 28/07/06 01:11 PM
Joined: Mar 2006
Posts: 50
T
Tw33ty Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2006
Posts: 50
Of course the user's gonna get asked via an $input if he really wanna delete the 'logdir'. If the $input is $true, only then logdir gets deleted.

PS: like I already mentioned, logdir must be deleted (depending upon require) because of spacewasting. But as soons as my script is unloaded, the log-directory will be created to mircdir again.