From: Michael Linfield Date: 2009-03-15T07:33:43+09:00 Subject: Re: Daemons and Paths Michael Linfield wrote: > I don't know if this is exactly what your looking for, but how about a > call to locate? > > begin > #worker code here > > rescue > path = %x[locate ].chomp! > #the filename would be whatever the daemon is > #looking for - you take the error code from > #the daemon and pull the filename out of it > > #Here we are going to take the path output > #then remove the last array element it's > #split by, aka the filename, so that u will > #have the directory > > directory = path.split("/") > directory.pop > directory.join("/") > Dir.chdir(directory) > > retry #retries the begin block > > end My apologies, correct the line that says directory.join("/") to the following: directory = directory.join("/") Regards, - Mac -- Posted via http://www.ruby-forum.com/.