mIRC Home    About    Download    Register    News    Help

Print Thread
#235688 05/01/12 06:17 PM
Joined: Nov 2011
Posts: 23
Q
Quinch Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Nov 2011
Posts: 23
Couple of mutually related questions, if anyone knows -

Can mIRC check if a file is already open for writing by another program before it attempts to write to it itself?

Can mIRC be set to watch for changes in a given file and trigger an alias when that file is changed?

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
You can watch for changes with this

Code:
on *:start:.timercheckfile 0 60 checkfile

alias checkfile {
  var %mtime = $file(file.txt).mtime
  if (%mtime > %file.mtime) || (!%file.mtime) {
    %file.mtime = %mtime
    ;file has changed do what you want
  }
}/


For checking if you can write to the file, I would suggest looking into /fopen and $ferr. I don't think there's a built in alias to give that information.

Joined: Nov 2011
Posts: 23
Q
Quinch Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Nov 2011
Posts: 23
Bit of a newbie question - what's the period in the ".timercheckfile" used for? I'm guessing it has to do with the timer command the checkfile alias but beyond that...

Last edited by Quinch; 06/01/12 07:16 AM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
From /help Commands:

Originally Posted By: mirc.hlp
If you want to force a command to perform quietly ie. without printing out any information, then you can prefix it with a "." full stop. For example:



/ignore somenick



Would print out information telling you that you are now ignoring "somenick". If you do not want this information to be displayed, then you can use:



/.ignore somenick



- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard