The OpenD Programming Language

FileEventDispatcher.addFile

You can add a file to listen to here. Files can be OS handles or Phobos types. The handlers can be null, meaning use the default (see: setDefaultHandler), or callables with zero or one argument. If they take an argument, it will be the file being handled at this time.

struct FileEventDispatcher
void
addFile
(
FileType
ReadEventHandler
WriteEventHandler
ErrorEventHandler
)
(
FileType handle
,
ReadEventHandler readEventHandler = null
,
WriteEventHandler writeEventHandler = null
,
ErrorEventHandler errorEventHandler = null
,
bool edgeTriggered = true
)
if (
templateCheckHelper!(is(FileType == OsFileHandle), "The FileType must be an operating system file handle") &&
templateCheckHelper!(isValidFileEventDispatcherHandler!(ReadEventHandler, FileType), "The ReadEventHandler was not valid")
&&
templateCheckHelper!(isValidFileEventDispatcherHandler!(WriteEventHandler, FileType), "The WriteEventHandler was not valid")
&&
templateCheckHelper!(isValidFileEventDispatcherHandler!(ErrorEventHandler, FileType), "The ErrorEventHandler was not valid")
)

Meta