Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[AHK_L/v2] WatchDirectory - Report Directory Changes


  • Please log in to reply
158 replies to this topic
flashkid
  • Members
  • 115 posts
  • Last active: Apr 12 2013 06:33 PM
  • Joined: 25 Aug 2007
I am using version 1.1.0.0 (01. May 2011). I have also tried it with the newest version and the new Ahk2Exe, but it doesn't work either.
Could you try to compile the script and check whether I do something wrong?

hughman
  • Members
  • 192 posts
  • Last active: Feb 14 2016 06:59 AM
  • Joined: 11 Feb 2007
edit

hughman
  • Members
  • 192 posts
  • Last active: Feb 14 2016 06:59 AM
  • Joined: 11 Feb 2007
I found a very strange problem:
if existing function whose name starts with some specific words such as "xml" in the script, then WatchDirectory can't report changes any more.
In order to find the bug I have spent so much time :( But I can't understand the reason, can you help me?
Below is my test code:
#Persistent
SetBatchLines,-1
SetWinDelay,-1
OnExit, @OnExit

WatchDirectory("g:\Develop\SQD\tmp", "ReportDirectoryChanges")
Return

Esc::
@OnExit:
	WatchDirectory("")
ExitApp

ReportDirectoryChanges(fromFile, toFile)
{
	MsgBox F:%fromFile%`nT:%toFile%
}

xml()
 {
 }


HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

I am using version 1.1.0.0 (01. May 2011). I have also tried it with the newest version and the new Ahk2Exe, but it doesn't work either.
Could you try to compile the script and check whether I do something wrong?

Can you try newest version ( also new _Struct() version).
Also try compiling 1.1.2.03 using new compiler.

I found a very strange problem:
if existing function whose name starts with some specific words such as "xml" in the script, then WatchDirectory can't report changes any more.
In order to find the bug I have spent so much time :( But I can't understand the reason, can you help me?

It works fine for me :? , can you try latest version.

hughman
  • Members
  • 192 posts
  • Last active: Feb 14 2016 06:59 AM
  • Joined: 11 Feb 2007
It works for the lastest version.
But I can't understand the cause for the old version.

Can u supply a version without depandance?

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

It works for the lastest version.
But I can't understand the cause for the old version.

Great :)
It worked for me with old version as well so I am not sure why it did not work for you
Can u supply a version without depandance?
No, this would just make it more complex and more difficult to maintain.

flashkid
  • Members
  • 115 posts
  • Last active: Apr 12 2013 06:33 PM
  • Joined: 25 Aug 2007
́

Can you try newest version ( also new _Struct() version).
Also try compiling 1.1.2.03 using new compiler.

Thanks, everything is working fine now :)

  • Guests
  • Last active:
  • Joined: --
I just tried this script and it does not seem to be working.

What I did:
1. downloaded _Struct.ahk and sizeof.ahk and put them in the lib folder.
2. ran the example and a GUI window with two listviews appeared.
3. created a text file in one of the listed directroy and nothing happens.

Am I missing something? (v1.1.03.00, Unicode, 64bit build)

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
I have fixed a bug in _Struct and sizeof() and corrected OVERLAPPED structure in WatchDirectory().
Can you redownload them all and try again.

  • Guests
  • Last active:
  • Joined: --
It seems to be working now. Thanks. This is useful.

  • Guests
  • Last active:
  • Joined: --
If I compile the script using this function, I get the this error.
Line Text: sizeof(_TYPE_)
Error: Duplicate function definition.

The program will exit.
This does not occur if the script is not compiled. And if I removed the line, #include <_Struct> and compile the script, there is no error but the function does not seem to respond.

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
This should be fixed in next AHK_L release. (Currently you can change it to something like
..\lib\sizeof.ahk

..\lib\_Struct.ahk


  • Guests
  • Last active:
  • Joined: --

This should be fixed in next AHK_L release. (Currently you can change it to something like

..\lib\sizeof.ahk

..\lib\_Struct.ahk

It doesn't make a difference for me. Isn't the line, #Include <sizeof> in _Struct.ahk causing the error?

  • Guests
  • Last active:
  • Joined: --
Another problem. I use the 64bit build and if I compile with the 32bit source file, Unicode 32-bit.bin, the function does not respond. It works with the 64 bit source file. (the line #Include <sizeof> in _Struct.ahk has to be removed to compile though.)

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

It doesn't make a difference for me. Isn't the line, #Include <sizeof> in _Struct.ahk causing the error?

Has to be replaced with above or similar, depends where your Lib directory is :!:

(the line #Include <sizeof> in _Struct.ahk has to be removed to compile though.)

Same as above, currently you have to use absolute path when compiling.