Search found 7 matches

by tsetse1510
10 Mar 2024, 01:11
Forum: Ask for Help (v2)
Topic: WatchFolder() - returning file size
Replies: 8
Views: 734

Re: WatchFolder() - returning file size

Mainly it was for "historical" reasons when I tried to find a workaround for ReadDirectoryChangesExW which worked less reliably on network drives.
But you are right, one could do the same stuff in userfunc and keep "WatchFolder.ahk" unchanged.
by tsetse1510
09 Mar 2024, 02:47
Forum: Ask for Help (v2)
Topic: WatchFolder() - returning file size
Replies: 8
Views: 734

Re: WatchFolder() - returning file size

Finally, I decided to add some lines of code to the original WatchFolder script to obtain the file size there. I only post the relevant part of the script. Modified lines are marked. ... Loop { FNIAddr += Offset OffSet := NumGet(FNIAddr + 0, "UInt") Action := NumGet(FNIAddr + 4, "UInt") Length := Nu...
by tsetse1510
01 Nov 2023, 14:30
Forum: Ask for Help (v2)
Topic: WatchFolder() - returning file size
Replies: 8
Views: 734

Re: WatchFolder() - returning file size

After further testing I realized, that the script works fine on local NTFS folders, but it does not work on network NTFS folders. The code ObjIndex := DllCall("WaitForMultipleObjects", "UInt", ObjCount, "Ptr", WaitObjects, "Int", 0, "UInt", 0, "UInt") seems to always return the value 0 in case of ne...
by tsetse1510
30 Oct 2023, 09:48
Forum: Ask for Help (v2)
Topic: WatchFolder() - returning file size
Replies: 8
Views: 734

Re: WatchFolder() - returning file size

just me Thank you. I did't consider that. Of course, I have to apply a factor of 1048576 to convert byte to megabyte. Therefore the corresponding line in the script should read: SizeMB := NumGet(FNIAddr + 48, "UInt64")/1048576 Now the returned file size is close to the value displayed by my file ex...
by tsetse1510
29 Oct 2023, 14:40
Forum: Ask for Help (v2)
Topic: WatchFolder() - returning file size
Replies: 8
Views: 734

Re: WatchFolder() - returning file size

Finally I managed to fix the bugs. Here comes the code for the modified WatchFolder() function, which now returns also file sizes. Just to not mix it with the original one I named it WatchFolderEx(). #Requires AutoHotKey v2.0 ; ========================================================================...
by tsetse1510
29 Oct 2023, 06:35
Forum: Ask for Help (v2)
Topic: WatchFolder() - returning file size
Replies: 8
Views: 734

WatchFolder() - returning file size

Here is my question: I want WatchFolder() https://www.autohotkey.com/boards/viewtopic.php?t=95659 to return the file size as well. For this purpose I consulted follwing pages: https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-file_notify_extended_information and https://learn.micros...
by tsetse1510
28 Oct 2023, 03:36
Forum: Scripts and Functions (v2)
Topic: WatchFolder() - monitor changes of files and/or folders
Replies: 7
Views: 3627

Re: WatchFolder() - monitor changes of files and/or folders

I tried to adopt WatchFolder() to return filze size to UserFunc() as well. However, I didn't manage. I expected that I could make use of FILE_NOTIFY_EXTENDED_INFORMATION structure. https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-file_notify_extended_information But it didn't work ...

Go to advanced search