Hi
playing with MonitorDirectory, i notice that it will report changes in a directory AND its subdirectories, however table.directory name is always the initian one
if for example i monitor C:\test will report changes in C:test\subtest changes too
but table.directory will only tell "C:\test" in both cases
Is there a way to determine what has changed ?
also it does not allow for slah but backslash !
MonitorDirectory(1, "E:/Alarm/1")<- accept
MonitorDirectory(1, "E:\Alarm\1")<- Unknown sequence character after backslash!
do i miss something ?
test under Windwos7
MonitorDirectory
MonitorDirectory
Christos
Re: MonitorDirectory
I don't know if OS itself reports either what's changed in the directory you monitor, so it might not be possible to get more detailed information. In these cases you should monitor each subdir themselves...
Of course it would be nice if it'd be possible to let us know what's changed, but if not, I would like to see a MonitorFile function too. I had to monitor datafile changes in RNOXfer's temp dir, and I ended up placing each data file in their own directory and monitor them that way. So, it would make things clearer if you could monitor individual files too. For example, the WaitForNotification shell command in MorphOS handles both directories and files.
Of course it would be nice if it'd be possible to let us know what's changed, but if not, I would like to see a MonitorFile function too. I had to monitor datafile changes in RNOXfer's temp dir, and I ended up placing each data file in their own directory and monitor them that way. So, it would make things clearer if you could monitor individual files too. For example, the WaitForNotification shell command in MorphOS handles both directories and files.
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: MonitorDirectory
I can confirm that it indeed triggers for subdirectories on Windows... this shouldn't be the case. I'll have to examine.
Then it should work.
Yes, backslashes must be escaped, i.e.
Code: Select all
MonitorDirectory(1, "E:\\Alarm\\1")
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: MonitorDirectory
Ok, so this isn't a bug. If you monitor the directory "test" and you change something in the directory "test/subdir", obviously the timestamp of the directory "subdir" changes which then triggers a change notification on "test". So this is perfectly right behaviour. You won't get a notification if you change anything two levels down the tree, i.e. monitor "test" and change something in "test/subdir/subdir". So all behaviour is completely correct here.
Re: MonitorDirectory
ok so, original question apply (it was orignilay a question )
"is there a way to determine what has changed ?"
i understand that you could get a list of files and dates, when first start program, and then compare it every time.
But this may be extremely time/cpu consuming if drawers get bigger and bigger
"is there a way to determine what has changed ?"
i understand that you could get a list of files and dates, when first start program, and then compare it every time.
But this may be extremely time/cpu consuming if drawers get bigger and bigger
Christos
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: MonitorDirectory
Code: Select all
- New [OS4/Windows]: MonitorDirectory() accepts a new "ReportChanges" tag now; if this is set to TRUE, your
event callback will also be notified about what exactly has changed; there will be two new parameters:
"Type" informing you about the type of change (add, remove, change) and "Name" will contain the name of
the file or directory that has been changed; note that the "All" argument has no effect when setting
"ReportChanges" to TRUE