Return to index

notify functions

notify_event = ev_event(watcher)

top

Sample events in watcher. Returns an event or nil.

Example:

# Example for ev_event
try
    println ev_event()
catch err
    println "No event available"
endtry


bool = ev_exists(watcher)

top

True if watcher should still be available for use.

Example:

# Example for ev_exists
watcher, err = ev_watch("/tmp")
println ev_exists(watcher)
ev_watch_close(watcher)


filename_or_nil = ev_mask(notify_event,str_event_type)

top

Is notify_event of type str_event_type? str_event_type can be one of create, write, remove, rename or chmod.

Example:

# Example for ev_mask
try
    ev_mask(0, 1)
catch err
    println "Error"
endtry


watcher,int_error_code = ev_watch(filepath_string)

top

Initialise a file system watch object. Returns the new watcher and 0 error code on success,


otherwise nil and >0 code. 1->create_watcher_failed, 2->file_path_failure

Example:

# Example for ev_watch
ev_watch("hello")  # usage


int_error_code = ev_watch_add(watcher,filepath_string)

top

Add another file path to watcher. Returns 0 on success, otherwise >0 code. e.g. 13->file permissions.

Example:

# Example for ev_watch_add
try
    println ev_watch_add(0, "/tmp")
catch err
    println "Error"
endtry


bool = ev_watch_close(watcher)

top

Dispose of a watcher object.

Example:

# Example for ev_watch_close
try
    ev_watch_close(0)
catch err
    println "Error"
endtry


int_error_code = ev_watch_remove(watcher,filepath_string)

top

Remove an existing file path in watcher. Returns 0 on success, otherwise >0 code.

Example:

# Example for ev_watch_remove
try
    ev_watch_remove(0, "/tmp")
catch err
    println "Error"
endtry