TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Automatically running a command whenever a file is saved

7 pointsby lenniover 14 years ago

3 comments

mthomasover 14 years ago
I notice that you're using a polling thread keep track of modification times. I know that linux has inotify: <a href="http://github.com/seb-m/pyinotify" rel="nofollow">http://github.com/seb-m/pyinotify</a> and OsX has something similar with FSEvents: <a href="http://pypi.python.org/pypi/MacFSEvents" rel="nofollow">http://pypi.python.org/pypi/MacFSEvents</a>
shabbleover 14 years ago
I quite like <a href="http://search.cpan.org/~drolsky/File-ChangeNotify-0.17/lib/File/ChangeNotify.pm" rel="nofollow">http://search.cpan.org/~drolsky/File-ChangeNotify-0.17/lib/F...</a> for perl. It's cross-platform (backends for linux, OSX/BSD and Win32 afaik), and is very straightforward to use.
评论 #1779430 未加载
zacharydangerover 14 years ago
Sounds like incron. Which is just a cron-like interface for inotify.