- PHP Tutorial
- PHP - Home
- PHP - Introduction
- PHP - Environment Setup
- PHP - Syntax Overview
- PHP - Variable Types
- PHP - Constants
- PHP - Operator Types
- PHP - Decision Making
- PHP - Loop Types
- PHP - Arrays
- PHP - Strings
- PHP - Web Concepts
- PHP - GET & POST
- PHP - File Inclusion
- PHP - Files & I/O
- PHP - Functions
- PHP - Cookies
- PHP - Sessions
- PHP - Sending Emails
- PHP - File Uploading
- PHP - Coding Standard
- Advanced PHP
- PHP - Predefined Variables
- PHP - Regular Expression
- PHP - Error Handling
- PHP - Bugs Debugging
- PHP - Date & Time
- PHP & MySQL
- PHP & AJAX
- PHP & XML
- PHP - Object Oriented
- PHP - For C Developers
- PHP - For PERL Developers
- PHP Form Examples
- PHP - Form Introduction
- PHP - Validation Example
- PHP - Complete Form
- PHP login Examples
- PHP - Login Example
- PHP - Facebook Login
- PHP - Paypal Integration
- PHP - MySQL Login
- PHP AJAX Examples
- PHP - AJAX Search
- PHP - AJAX XML Parser
- PHP - AJAX Auto Complete Search
- PHP - AJAX RSS Feed Example
- PHP XML Example
- PHP - XML Introduction
- PHP - Simple XML
- PHP - Simple XML GET
- PHP - SAX Parser Example
- PHP - DOM Parser Example
- PHP Frame Works
- PHP - Frame Works
- PHP - Core PHP vs Frame Works
- PHP Design Patterns
- PHP - Design Patterns
- PHP Function Reference
- PHP - Built-In Functions
- PHP Useful Resources
- PHP - Questions & Answers
- PHP - Useful Resources
- PHP - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
PHP - Inotify Functions
The inotify extension can expose inotify functions: inotify_init(), inotify_add_watch() and inotify_rm_watch().
As the C inotify_init() function return a file descriptor, PHP's inotify_init() function return a stream resource usable with standard stream functions: stream_select(), stream_set_blocking(), and fclose(). inotify_read() can replace the C way of reading inotify events.
This extension can require Linux 2.6.13 or newer and the recent libC.
This extension has no configuration directives that can be defined in php.ini.
This extension can define a stream resource that has returned by the inotify_init() function.
The constants are defined below by this extension and can be available only when an extension has either compiled into PHP or dynamically loaded at runtime.
Inotify constants can be usable with inotify_add_watch() and/or returned by inotify_read().
IN_ACCESS (integer) − File was accessed (read) (*)
IN_MODIFY (integer) − File was modified (*)
IN_ATTRIB (integer) − Metadata changed (e.g. permissions, mtime, etc.) (*)
IN_CLOSE_WRITE (integer) − File opened for writing was closed (*)
IN_CLOSE_NOWRITE (integer) − File not opened for writing was closed (*)
IN_OPEN (integer) − File was opened (*)
IN_MOVED_TO (integer) − File moved into watched directory (*)
IN_MOVED_FROM (integer) − File moved out of watched directory (*)
IN_CREATE (integer) − File or directory created in watched directory (*)
IN_DELETE (integer) − File or directory deleted in watched directory (*)
IN_DELETE_SELF (integer) − Watched file or directory was deleted
IN_MOVE_SELF (integer) − Watch file or directory was moved
IN_CLOSE (integer) − Equals to IN_CLOSE_WRITE | IN_CLOSE_NOWRITE
IN_MOVE (integer) − Equals to IN_MOVED_FROM | IN_MOVED_TO
IN_ALL_EVENTS (integer) − Bitmask of all the above constants
IN_UNMOUNT (integer) − File system containing watched object was unmounted
IN_Q_OVERFLOW (integer) − Event queue overflowed (wd is -1 for this event)
IN_IGNORED (integer) − Watch was removed (explicitly by inotify_rm_watch() or because file was removed or filesystem unmounted
IN_ISDIR (integer) − Subject of this event is a directory
IN_ONLYDIR (integer) − Only watch pathname if it is a directory (Since Linux 2.6.15)
IN_DONT_FOLLOW (integer) − Do not dereference pathname if it is a symlink (Since Linux 2.6.15)
IN_MASK_ADD (integer) − Add events to watch mask for this pathname if it already exists (instead of replacing mask).
IN_ONESHOT (integer) − Monitor pathname for one event, then remove from watch list.
|Sr.No||Function & Description|
Function can add a watch to an initialized inotify instance.
Function can initialize an inotify instance.
Function can return a number upper than zero if there are pending events.
Function can read events from an inotify instance.
Function can remove an existing watch from an inotify instance.