On Thu, September 20, 2007 3:35 pm, Carl Lowenstein wrote:
> On 9/20/07, Brad Beyenhof <[EMAIL PROTECTED]> wrote:
>> Is there any way to trigger a script just by placing a document into a
>> folder? i.e. Can I print to a file and, by virtue of saving it into a
>> certain "watched" directory, have the new file's path passed as an
>> argument to a script?
>
> Probably so. This question comes up occasionally in the news group
> comp.lang.postscript. You might try searching the archives on
> google/groups. Not sure offhand what the proper search terms would
> be.
>
Actually, I've scripted stuff to do exactly this, and if I can do it, it's
trivial indeed. I wrote a little daemon script that did:
while TRUE {
sleep $aTime
if {(present && !processed) file} {
process
mark processed
}
}
Thing is, scripts can't run as root, so you have to start it as a user.
(Hmm ... do I have to _say_ this is pseudocode? Naw, they're not _that_
dumb.)
--
Lan Barnes
SCM Analyst Linux Guy
Tcl/Tk Enthusiast Biodiesel Brewer
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-newbie