Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Watch Directory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sun Jan 03, 2021 10:47 am    Post subject: Watch Directory Reply with quote

Working on project workspace for Script Editor, for responsiveness and sake of not polling information every few seconds built this small module.

Ported from this

Place in Autorun and access through watchDirectory table, or require.

Some how to use/information
Code:
--[[
   watchDirectory.add( path:string, callback:function, subtree:boolean, filterFlags:number ):handle
   watchDirectory.remove(handle)
   
   notes:
      path: full path string (max length of MAX_PATH - 260), you cannot watch the same path!
      subtree: track changes to child directories as well
      filterFlags: pass "folder" to watch changes to files/folders (creation/deletion of directories/files,*renaming is deleting and then creating)
         otherwise default is watch only files (create/delete/write events)
         
         for more information refer to: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirstchangenotificationa
      
      *this class cannot pass what files or kind of changes has occured, to the callback function.

   
   -- example script....
   local myPath = "C:\\MyPath\\"
   local onMyPathChange = function()
      print('A change occured to the path:',myPath); -- when a file
   end
   myPathWatchHandle = watchDirectory.add(myPath,onMyPathChange,false,"folder")
   
   -- remove watch notification from directory
   -- watchDirectory.remove(myPathWatchHandle);
--]]



watch_directory.lua
 Description:
03/01/2021 -- fixed some typo and multiple directories bug

Download
 Filename:  watch_directory.lua
 Filesize:  6.31 KB
 Downloaded:  510 Time(s)


_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites