1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>monitor_collection (Fam::Connection)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
<pre>/*
* Monitor a collection.
*
* Raises a Fam::Error exception if the collection could not be
* monitored. Note that this method exists under Gamin, but does not
* actually do anything.
*
* Aliases:
* Fam::Collection#monitor_col
* Fam::Collection#col
*
* Examples:
* req = fam.monitor_col 'download/images', 1, '*.jpg'
*
*/
static VALUE fam_conn_col(VALUE self, VALUE col, VALUE depth, VALUE mask)
{
FAMConnection *conn;
FAMRequest *req = NULL;
int err;
Data_Get_Struct(self, FAMConnection, conn);
req = ALLOC(FAMRequest);
FAMREQUEST_GETREQNUM(req) = (int) req;
err = FAMMonitorCollection(conn,
RSTRING(col)->ptr,
req,
NULL,
NUM2INT(depth),
RSTRING(mask)->ptr);
if (err == -1) {
xfree(req);
rb_raise(eError, "Couldn't monitor collection [\"%s\", %d, \"%s\"]: %s",
RSTRING(col)->ptr ? RSTRING(col)->ptr : "NULL",
NUM2INT(depth),
RSTRING(mask)->ptr ? RSTRING(mask)->ptr : "NULL",
fam_error());
}
return wrap_req(req);
}</pre>
</body>
</html>
|