Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

DirectoryWatcher.AddDirectory

Adds a directory to watch.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DirectoryWatcher 7.1 No Yes Yes, Windows only No No

MBS( "DirectoryWatcher.AddDirectory"; Watcher; Path; recursive; Action )

Parameters

Parameter Description Example value
Watcher The watcher reference number. $watcher
Path The directory path to verify. "C:\Users\Administrator\Desktop"
recursive Whether to recursively check subdirectories.
Pass 1 to turn on or 0 to turn off.
1
Action The changes to monitor. "Filename¶DirName¶Attributes¶Size¶LastWrite¶LastAccess¶Creation¶Security"

Result

Returns OK or error.

Description

Adds a directory to watch.
With the actions you can define what changes to report.

ActionValueDescription
Filename1Any file name change in the watched directory or subtree causes a change notification wait operation to return. Changes include renaming, creating, or deleting a file name.
DirName2Any directory-name change in the watched directory or subtree causes a change notification wait operation to return. Changes include creating or deleting a directory.
Attributes4Any attribute change in the watched directory or subtree causes a change notification wait operation to return.
Size8Any file-size change in the watched directory or subtree causes a change notification wait operation to return. The operating system detects a change in file size only when the file is written to the disk. For operating systems that use extensive caching, detection occurs only when the cache is sufficiently flushed.
LastWrite16Any change to the last write-time of files in the watched directory or subtree causes a change notification wait operation to return. The operating system detects a change to the last write-time only when the file is written to the disk. For operating systems that use extensive caching, detection occurs only when the cache is sufficiently flushed.
LastAccess32Any change to the last access time of files in the watched directory or subtree causes a change notification wait operation to return.
Creation64Any change to the creation time of files in the watched directory or subtree causes a change notification wait operation to return.
Security256Any security-descriptor change in the watched directory or subtree causes a change notification wait operation to return.

Examples

Watch for changes in directory:

MBS("DirectoryWatcher.AddDirectory"; $Watcher; Directory Watcher::Directory; 1; "Filename¶DirName¶Attributes¶Size¶LastWrite¶LastAccess¶Creation¶Security")

Example Databases


Dictionary.Values   -   DirectoryWatcher.ChangeCount

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins