|
-
Jul 10th, 2001, 05:08 AM
#1
Check directory content change with API call
I need my directory to be frequently checked, if there are any new files in there. If there are the files are being read (and parsed) and deleted afterwards. I have that stuff done actually already (thanx to Peet !! ), here's the code which does it:
------------------------------------------
Private Sub Timer1_Timer()
Dim sFile As String
Dim sPath As String
sPath = "C:\ABCD\"
While Dir(sPath & "*.*", vbHidden + vbNormal + vbReadOnly + vbSystem) <>
""
sFile = Dir(sPath & "*.*", vbHidden + vbNormal + vbReadOnly +
vbSystem)
MsgBox sFile
'parse thing
'delete the file etc.
Kill sPath & sFile
Wend
End Sub
----------------
Because I have timer to check the directory change (every 3 seconds) I would like to improve it with some API call (so that OS will let it know when it changes and timer wont be needed anymore). Please help me with that, I have no idea how to do it with API...
Thanx in advance !
-
Jul 10th, 2001, 05:42 AM
#2
Addicted Member
Reynard,
Brad Martinez web site has a very good eample for recieving shell change notifications. You can download the exmple from :-
://www.mvps.org/btmtz/shnotify
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|