hannobraun / inotify-rs

Idiomatic inotify wrapper for the Rust programming language
ISC License
261 stars 65 forks source link

Increase the buffer size for the stream example #187

Closed epompeii closed 2 years ago

epompeii commented 3 years ago

This pull request increases the inotify event buffer size for the stream example from 32 to 1024 as discussed in Issue https://github.com/hannobraun/inotify-rs/issues/186.

Also included are two utility functions, get_buffer_size() and get_absolute_path_buffer_size(). The former is just a light, fallible wrapper around the latter. get_buffer_size() is meant to work with both relative and absolute paths, as it handles the canonicalization of the path. get_absolute_path_buffer_size() expects an absolute path to be passed in, and it is only meant to be used when a path is known to be absolute.

edit by @hannobraun: Close #186 (this should close the issue automatically when this is merged, so we don't forget)

epompeii commented 2 years ago

Good catch! I think you are right. I have made both changes.

hannobraun commented 2 years ago

Thanks!