Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Folder watch
#7
Hi Gintaras, hi all,

revive the thread cos I could use it in different way, but I need to tweak it.

Function ReparseTest
Trigger $f 0xBFF "T:\WatchedFolder"     Help - how to add the trigger to the macro
Code:
Copy      Help
function event $name [$newname]
;event: 1 added, 2 removed, 4 renamed, 8 modified
_s=name
sel event
,case [8]:
,int attr=GetFileAttributesW(@F"{name}"); if(attr=-1) end "failed, %s" 0 _s.dllerror
,if(attr&FILE_ATTRIBUTE_REPARSE_POINT) UseUSBDisk(_s)
,;else out F"{name} directory"

This code works flawlessly for months now, is used to mount USB disk to junction, and i'd like to extend it that way:

When a junction is created, a new *dynamic* file/folder trigger function is launched to monitor the newly created junction for monitoring file/folder changes
on the USB disk, and when junction is no more used (ie USB disk is disconnected), the new trigger function stops.

Possible?

Thanks.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)