Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ronsaldo/os-ioevents

Library for getting asynchronous OS specific events in Pharo.
https://github.com/ronsaldo/os-ioevents

Last synced: about 1 month ago
JSON representation

Library for getting asynchronous OS specific events in Pharo.

Awesome Lists containing this project

README

        

# OS IO Events - Bindings to non-blocking IO Events in Pharo.

----
## Loading in a Pharo image

```smalltalk
Metacello new
baseline: 'OSIOEvents';
repository: 'github://ronsaldo/os-ioevents';
load.
```

## FileSystem monitor example
The following script is an example on how to use the file system monitoring library:

```smalltalk
OSIOFileSystemMonitor on: '.' asFileReference when: OSIOFileEventCreate do: [ :ev |
Transcript show: 'Create '; show: ev fileReference; cr.
].
OSIOFileSystemMonitor on: '.' asFileReference when: OSIOFileEventDelete do: [ :ev |
Transcript show: 'Delete '; show: ev fileReference; cr.
].
subscription := OSIOFileSystemMonitor on: '.' asFileReference when: OSIOFileEventCloseWrite do: [ :ev |
Transcript show: 'Close Write '; show: ev fileReference; cr.
].
"
subscription unsubscribe
"
```