Advice wanted on how to proceed . . .
site_archiver@lists.apple.com Delivered-To: Darwin-kernel@lists.apple.com Thread-index: AcadSpILGik4w4cyS+2MsemQXkA5qwCQzGCw Hi. I posted a kind of generic question a month or two ago about communication between kernel- and user-space and got some responses which were very helpful. However, before I continue my investigation, I wanted to briefly describe what I'm trying to do and make sure I'm on the right track so I don't waste any time on the wrong approach(es). Very briefly: When you drag a URL from Safari to the Finder it saves the link as a .webloc, which is an empty file with the URL and title of the page in a resource fork. I find this annoying because it's antiquated and non-portable. I check my bookmarks into Subversion to sync them across different machines, so this doesn't work for me. I wrote a little utility to walk through a directory tree and replace any .webloc files it finds with .url (Microsoft IE) files, which are simply text files. Since double-click on a .url file on a Mac will open the link in Safari, this has worked just fine for me. What I want to do now is automate the process so that whenever I save a link anywhere in the filesystem, it's automatically converted into a .url file. I'd lookeed into writing a kernel extension that uses the kauth API to be notified whenever a .webloc file is closed, and then notify a user-space process of the location of the file so that it can read it and replace it with a .url file. However, it also seems I could just write a Spotlight importer and not mess with the kernel at all.
From browsing the Apple developer site, and reading the messages on this list, it seems like there are a number of ways to accomplish this. I think I'd prefer to write this as a kernel extension, but there seems to be a dearth of example code for kernel-userspace commmunications. What I'd like to ask is if anyone has any advice for the best way to go about doing this. What's the best mechanism to use? Where can I find example code? What are the pitfalls? Etc...
This is a just a small side project for me, so I'm trying not to invest more time in it than I absolutely have to. Naturally, if I ever manage to produce something useful, I will open source it and make it available to whoever else might find it useful. Thanks in advance, Bruce _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Bruce Fancher