/* {"description" : "Event details, for file system events."} */
data FileEventInfo{
const byte E_CREATE = 1
const byte E_DELETE = 2
const byte E_MODIFY = 3
const byte E_RENAME = 4
/* {"@description" : "This field indicates what kind of change event is being reported, taking a value from the E_ constants."} */
byte eventType
const byte I_FILE = 1
const byte I_DIRECTORY = 2
/* {"@description" : "This field indicates whether itemPath is a file or directory, taking a value from the I_ constants."} */
byte itemType
/* {"@description" : "The path of the file system element being watched."} */
char listenPath[]
/* {"@description" : "The path of file system element to which the event relates (only used for directory-based events)."} */
char itemPath[]
/* {"@description" : "The path of file system element to which the event relates (only used for directory-based events)."} */
char itemPathB[]
}
/* {"description" : "Register to receive events for file system changes."} */
interface FileSystemEvents {
event fileEvent(FileEventInfo e)
event directoryEvent(FileEventInfo e)
/* {"@description" : "Construct a new file system event listener."} */
FileSystemEvents()
/* {"@description" : "Listen for changes to a given file."} */
bool listenFile(char path[])
/* {"@description" : "Stop listening for changes to a given file."} */
void unlistenFile(char path[])
/* {"@description" : "Listen for changes to a given directory (monitoring its contents)."} */
bool listenDirectory(char path[])
/* {"@description" : "Stop listening for changes to a given directory."} */
void unlistenDirectory(char path[])
}
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n io.FileSystemEvents -m "reason for update" -u yourUsername
Version 1 (this version) by barry
Notes for this version: Adds API to monitor changes to file system elements