fam_cancel_monitor

Terminate monitoring

说明

bool fam_cancel_monitor ( resource $fam , resource $fam_monitor )

Terminates monitoring on a resource.

In addition an FAMAcknowledge event occurs.

参数

fam
A resource representing a connection to the FAM service returned by fam_open

fam_monitor
A resource returned by one of the fam_monitor_XXX functions

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • fam_monitor_file
  • fam_monitor_directory
  • fam_monitor_collection
  • fam_suspend_monitor

fam_close

Close FAM connection

说明

void fam_close ( resource $fam )

Closes a connection to the FAM service.

参数

fam
A resource representing a connection to the FAM service returned by fam_open

返回值

没有返回值。

参见

  • fam_monitor_open

fam_monitor_collection

Monitor a collection of files in a directory for changes

说明

resource fam_monitor_collection ( resource $fam , string $dirname , int $depth , string $mask )

Requests monitoring for a collection of files within a directory.

A FAM event will be generated whenever the status of the files change. The possible event codes are described in detail in the constants part of this section.

参数

fam
A resource representing a connection to the FAM service returned by fam_open

dirname
Directory path to the monitored files

depth
The maximum search depth starting from this directory

mask
A shell pattern mask restricting the file names to look for

返回值

Returns a monitoring resource or FALSE on errors.

参见

  • fam_monitor_file
  • fam_monitor_directory
  • fam_cancel_monitor
  • fam_suspend_monitor
  • fam_resume_monitor

fam_monitor_directory

Monitor a directory for changes

说明

resource fam_monitor_directory ( resource $fam , string $dirname )

Requests monitoring for a directory and all contained files.

A FAM event will be generated whenever the status of the directory (i.e. the result of function stat on that directory) or its content (i.e. the results of readdir) changes.

The possible event codes are described in detail in the constants part of this section.

参数

fam
A resource representing a connection to the FAM service returned by fam_open

dirname
Path to the monitored directory

返回值

Returns a monitoring resource or FALSE on errors.

参见

  • fam_monitor_file
  • fam_monitor_collection
  • fam_cancel_monitor
  • fam_suspend_monitor
  • fam_resume_monitor

fam_monitor_file

Monitor a regular file for changes

说明

resource fam_monitor_file ( resource $fam , string $filename )

Requests monitoring for a single file. A FAM event will be generated whenever the file status changes (i.e. the result of function stat on that file).

The possible event codes are described in detail in the constants part of this section.

参数

fam
A resource representing a connection to the FAM service returned by fam_open

filename
Path to the monitored file

返回值

Returns a monitoring resource or FALSE on errors.

参见

  • fam_monitor_directory
  • fam_monitor_collection
  • fam_cancel_monitor
  • fam_suspend_monitor
  • fam_resume_monitor

fam_next_event

Get next pending FAM event

说明

array fam_next_event ( resource $fam )

Returns the next pending FAM event.

The function will block until an event is available which can be checked for using fam_pending.

参数

fam
A resource representing a connection to the FAM service returned by fam_open

返回值

Returns an array that contains a FAM event code in the 'code' element, the path of the file this event applies to in the 'filename' element and optionally a hostname in the 'hostname' element.

The possible event codes are described in detail in the constants part of this section.

参见

  • fam_pending

fam_open

Open connection to FAM daemon

说明

resource fam_open ([ string $appname ] )

Opens a connection to the FAM service daemon.

参数

appname
A string identifying the application for logging reasons

返回值

Returns a resource representing a connection to the FAM service on success or FALSE on errors.

参见

  • fam_close

fam_pending

Check for pending FAM events

说明

int fam_pending ( resource $fam )

Checks for pending FAM events.

参数

fam
A resource representing a connection to the FAM service returned by fam_open

返回值

Returns non-zero if events are available to be fetched using fam_next_event, zero otherwise.

参见

  • fam_next_event

fam_resume_monitor

Resume suspended monitoring

说明

bool fam_resume_monitor ( resource $fam , resource $fam_monitor )

Resumes monitoring of a resource previously suspended using fam_suspend_monitor.

参数

fam
A resource representing a connection to the FAM service returned by fam_open

fam_monitor
A resource returned by one of the fam_monitor_XXX functions

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • fam_suspend_monitor

fam_suspend_monitor

Temporarily suspend monitoring

说明

bool fam_suspend_monitor ( resource $fam , resource $fam_monitor )

fam_suspend_monitor temporarily suspend monitoring of a resource.

Monitoring can later be continued using fam_resume_monitor without the need of requesting a complete new monitor.

参数

fam
A resource representing a connection to the FAM service returned by fam_open

fam_monitor
A resource returned by one of the fam_monitor_XXX functions

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

参见

  • fam_cancel_monitor
  • fam_resume_monitor

目录