Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
pfSense
All Projects
pfSense
Overview
Activity
Roadmap
Issues
Download (451 Bytes)
Feature #403
» monitor-fam.php
znerol znerol
, 03/06/2010 05:22 AM
<?php
$path
=
"/tmp/test.txt"
;
function
print_file
()
{
echo
(
"
\n
****"
);
echo
(
file_get_contents
(
$path
));
echo
(
"
\n
"
);
}
// create base and event
$famd
=
fam_open
();
if
(
$famd
===
FALSE
)
{
print
(
"could not connect to famd
\n
"
);
}
$mon
=
fam_monitor_file
(
$famd
,
$path
);
if
(
$mon
===
FALSE
)
{
print
(
"failed to setup file monitor
\n
"
);
}
while
(
TRUE
)
{
$result
=
fam_next_event
(
$famd
);
if
(
$result
[
'code'
]
==
FAMChanged
)
{
print_file
();
}
}
?>
« Previous
1
2
3
4
5
Next »
(2-2/5)
Loading...