{"action":"created","issue":{"url":"https://api.github.com/repos/Ferada/cl-inotify/issues/4","labels_url":"https://api.github.com/repos/Ferada/cl-inotify/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/Ferada/cl-inotify/issues/4/comments","events_url":"https://api.github.com/repos/Ferada/cl-inotify/issues/4/events","html_url":"https://github.com/Ferada/cl-inotify/issues/4","id":54680384,"number":4,"title":"Please explain how cl-inotify make event-based come true","user":{"login":"muyinliu","id":3318872,"avatar_url":"https://avatars.githubusercontent.com/u/3318872?v=3","gravatar_id":"","url":"https://api.github.com/users/muyinliu","html_url":"https://github.com/muyinliu","followers_url":"https://api.github.com/users/muyinliu/followers","following_url":"https://api.github.com/users/muyinliu/following{/other_user}","gists_url":"https://api.github.com/users/muyinliu/gists{/gist_id}","starred_url":"https://api.github.com/users/muyinliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muyinliu/subscriptions","organizations_url":"https://api.github.com/users/muyinliu/orgs","repos_url":"https://api.github.com/users/muyinliu/repos","events_url":"https://api.github.com/users/muyinliu/events{/privacy}","received_events_url":"https://api.github.com/users/muyinliu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-17T23:57:24Z","updated_at":"2015-01-19T10:35:55Z","closed_at":null,"body":"I am not familiar with `iolib`, can anyone explain how `cl-inotify` make event-based come true?\r\n\r\nI want to trun `cl-fsnotify` into event-based, otherwise `cl-fsnotify` can't watch the events happen in subdirectories(because `inotify` in Linux won't watch subdirectories itself). `kqueue` in Mac/Unix seems watch subdirectories automatically."},"comment":{"url":"https://api.github.com/repos/Ferada/cl-inotify/issues/comments/70473752","html_url":"https://github.com/Ferada/cl-inotify/issues/4#issuecomment-70473752","issue_url":"https://api.github.com/repos/Ferada/cl-inotify/issues/4","id":70473752,"user":{"login":"Ferada","id":13713,"avatar_url":"https://avatars.githubusercontent.com/u/13713?v=3","gravatar_id":"","url":"https://api.github.com/users/Ferada","html_url":"https://github.com/Ferada","followers_url":"https://api.github.com/users/Ferada/followers","following_url":"https://api.github.com/users/Ferada/following{/other_user}","gists_url":"https://api.github.com/users/Ferada/gists{/gist_id}","starred_url":"https://api.github.com/users/Ferada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ferada/subscriptions","organizations_url":"https://api.github.com/users/Ferada/orgs","repos_url":"https://api.github.com/users/Ferada/repos","events_url":"https://api.github.com/users/Ferada/events{/privacy}","received_events_url":"https://api.github.com/users/Ferada/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T10:35:55Z","updated_at":"2015-01-19T10:35:55Z","body":"> I am not familiar with `iolib`, can anyone explain how `cl-inotify` make event-based come true?\r\n\r\nI have one example in [iolib.lisp](https://github.com/Ferada/cl-inotify/blob/master/iolib.lisp); basically with `iolib` it will watch a couple of file descriptors (e.g. from `inotify-fd` in that example) and if any of those have new data (or the connection was terminated, ...) the handler will be invoked. That file is not loaded automatically however and it's just a proof of concept really.\r\n\r\n> I want to trun `cl-fsnotify` into event-based, otherwise `cl-fsnotify` can't watch the events happen in subdirectories(because inotify in Linux won't watch subdirectories itself). kqueue in Mac/Unix seems watch subdirectories automatically.\r\n\r\nThat may be, I haven't tried the kqueue approach yet. Yes, so you'll definitely want to watch new directories as they are created. With `cl-fsnotify` you should be able to do a similar approach, i.e. watch the file descriptor returned by `inotify-fd` and then get all events with `get-events` at that time, then watch the new directories."}}