Comments (5)
from imv.
My preference would be to avoid adding new libraries when possible, to try and keep the requirements of imv small. Compatibility with other unices and unix-likes is definitely something I'd like to maintain support for.
from imv.
I see three possible ways to provide this functionality on non-Linux platforms:
kqueue(2)
is available on BSDs (including OS X and probably Minix).libinotify-kqueue
adds inotify support to kqueue-enabled systems.stat(2)
is available on every Unix-like system.
My initial urge was to do exactly as @eXeC64 says: move reload.c
to reload-inotify.c
, add reload-kqueue.c
and some magic to Makefile to pick right thing. There are dragons here, as kqueue requires keeping descriptors for all watched files around, which has potential to cause descriptor starvation. Also, kqueue won't work on some filesystems. Same issues apply to libinotify-kqueue.
I'd rather go with the following option:
- Call
stat(2)
and remember mtime when adding files to navigator. - Call
stat(2)
again before displaying file and compare actual mtime to stored mtime.
This should not have significant overhead. In fact it may turn out to be faster then creating and destroying inotify watches (one stat(2)
operation instead of one write(2)
and two read(2)
s), and it is more reliable in some scenarios. Eg. inotify will not report changes on NFS.
If this plan sounds sane, I'll come up with pull request.
from imv.
P.S.: while testing my approach I've noticed that libinotify-kqueue doesn't seem to work for me at all...
from imv.
Fixed by #68
from imv.
Related Issues (20)
- Multiline overlay text HOT 3
- Unable to redner BIG png image HOT 11
- No longer builds with -Dlibrsvg=disabled due to missing libm for exp()
- Launching imv displays a black window
- image list HOT 1
- Fullscreen + reset/center key binding with shrink scaling mode
- Add option to launch imv with the initial image's width and height
- imv unable to open huge images HOT 1
- broken link prevents loading some images from the directory HOT 1
- Slow zoom speed on large images HOT 2
- wayland: committing resized buffer is delayed HOT 1
- Please cut a new release HOT 1
- Padding for the overlay
- Mouse cursor state not set when entering window
- recursively configuration option is unknown
- full-core usage on wayland compositor exit
- scientific tif options?
- Shutdown errors on arch linux / sway
- Weird/laggy mouse movement
- Imv-wayland on enlightenment wayland session.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imv.