Sign in to follow this  
Followers 0
Zomp

detect any file change

6 posts in this topic

I wish to monitor any file change in some folder (a new file is created, a file is deleted, a file is changed). Is it possible to do it? And if yes, how?

Many thanks.

Share this post


Link to post
Share on other sites




[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You can also use FileGetSize and then compare sizes.

$size1 = FileGetSize("path")
...
$size2 = FileGetSize("path")
If $size1 <> $size2 Then MsgBox(0, "", "File has been changed.")
Edited by Aassdd

Share this post


Link to post
Share on other sites

I wish to monitor any file change in some folder (a new file is created, a file is deleted, a file is changed). Is it possible to do it? And if yes, how?

Many thanks.

For methods tied to the actual file system events, check ptrex's here http://www.autoitscript.com/forum/index.ph...=42511&st=0 and arcker's here http://www.autoitscript.com/forum/index.ph...st&p=337058

Share this post


Link to post
Share on other sites

For methods tied to the actual file system events, check ptrex's here http://www.autoitscript.com/forum/index.ph...=42511&st=0 and arcker's here http://www.autoitscript.com/forum/index.ph...st&p=337058

Thanks for your useful links.

In arcker post, he says that when monitoring subdirectories his script consumes a lot of resources, and he suggests to "sink everydirectory". Do you understand what does it mean?

Share this post


Link to post
Share on other sites

Thanks for your useful links.

In arcker post, he says that when monitoring subdirectories his script consumes a lot of resources, and he suggests to "sink everydirectory". Do you understand what does it mean?

Actually, I don't. :)

I haven't really played with his version beyond running his example (because I didn't really uderstand it all).

I just knew that it would probably be useful someday and I'd look at it then and try to figure it out.

So far, I've been mostly using ptrex's idea.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0