Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Folder Size
Message
 
To
29/07/2003 14:49:15
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00814652
Message ID:
00814682
Views:
18
From what you said I understand that you have to monitor the size of a folder.

Check two examples:

Monitoring changes in a directory
http://www.news2news.com/vfp/?example=117&function=168

This code is based on a timer calling FindFirstChangeNotification API function.

Monitoring changes occurring within a directory (Win2K/XP)
http://www.news2news.com/vfp/?example=400

This code stays in a constant loop waiting for a change within a directory: any file name, attributes, size etc. depending on FILE_NOTIFY_CHANGE flags set. Using of ReadDirectoryChangesW API function is limited in VFP code unless you decide to call this function from FLL.

* * *
Once you have a notification that a file changed within the directory, you may run a procedure calculating the total size of the files.
#DEFINE FILE_NOTIFY_CHANGE_FILE_NAME      1
#DEFINE FILE_NOTIFY_CHANGE_DIR_NAME       2
#DEFINE FILE_NOTIFY_CHANGE_ATTRIBUTES     4
#DEFINE FILE_NOTIFY_CHANGE_SIZE           8
#DEFINE FILE_NOTIFY_CHANGE_LAST_WRITE    16
#DEFINE FILE_NOTIFY_CHANGE_LAST_ACCESS   32
#DEFINE FILE_NOTIFY_CHANGE_CREATION      64
#DEFINE FILE_NOTIFY_CHANGE_SECURITY     128
Previous
Reply
Map
View

Click here to load this message in the networking platform