FileWatchEvent
classin packageklyn.io
public class FileWatchEvent extends Event:
└ FileWatchEvent

Payload emitted by FileWatcher when the watched file state changes.

kind is one of created, modified or deleted. The event carries the previous and current filesystem metadata so handlers can decide whether a size-only or timestamp-only change matters for their use case.

watcher.changed += lambda(e: FileWatchEvent): print(e.kind)
Properties
Modifier and Type Member Description
public readonly property exists
exists as Boolean
Whether the file exists after the change.
public readonly property kind
kind as String
Change kind: created, modified, or deleted.
public readonly property lastModified
lastModified as Long
Current modification timestamp.
public readonly property path
path as Path
Watched path.
public readonly property previousExists
previousExists as Boolean
Whether the file existed before the change.
public readonly property previousLastModified
previousLastModified as Long
Previous modification timestamp.
public readonly property previousSize
previousSize as ULong
Previous file size in bytes.
public readonly property size
size as ULong
Current file size in bytes.
Properties inherited from Event: source, timestamp
Constructors
Modifier and Type Member Description
public FileWatchEvent
FileWatchEvent(source as Object, path as Path, kind as String, previousExists as Boolean, exists as Boolean, previousLastModified as Long, lastModified as Long, previousSize as ULong, size as ULong):
Creates a file-watch event payload.