… | |
… | |
576 | as even with OS-supported change notifications, this can be |
576 | as even with OS-supported change notifications, this can be |
577 | resource-intensive. |
577 | resource-intensive. |
578 | |
578 | |
579 | The C<stat_ns> variant doesn't start (activate) the newly created watcher. |
579 | The C<stat_ns> variant doesn't start (activate) the newly created watcher. |
580 | |
580 | |
|
|
581 | =item ... = $w->stat |
|
|
582 | |
|
|
583 | This call is very similar to the perl C<stat> built-in: It stats (using |
|
|
584 | C<lstat>) the path specified in the watcher and sets perls stat cache (as |
|
|
585 | well as EV's idea of the current stat values) to the values found. |
|
|
586 | |
|
|
587 | In scalar context, a boolean is return indicating success or failure of |
|
|
588 | the stat. In list context, the same 13-value list as with stat is returned |
|
|
589 | (except that the blksize and blocks fields are not reliable). |
|
|
590 | |
|
|
591 | In the case of an error, errno is set to C<ENOENT> (regardless of the |
|
|
592 | actual error value) and the C<nlink> value is forced to zero (if the stat |
|
|
593 | was successful then nlink is guaranteed to be non-zero). |
|
|
594 | |
|
|
595 | See also the next two entries for more info. |
|
|
596 | |
|
|
597 | =item ... = $w->attr |
|
|
598 | |
|
|
599 | Just like C<< $w->stat >>, but without the initial stat'ing: this returns |
|
|
600 | the values most recently detected by EV. See the next entry for more info. |
|
|
601 | |
|
|
602 | =item ... = $w->prev |
|
|
603 | |
|
|
604 | Just like C<< $w->stat >>, but without the initial stat'ing: this returns |
|
|
605 | the previous set of values, before the change. |
|
|
606 | |
|
|
607 | That is, when the watcher callback is invoked, C<< $w->prev >> will be set |
|
|
608 | to the values found I<before> a change was detected, while C<< $w->attr >> |
|
|
609 | returns the values found leading to the change detection. The difference (if any) |
|
|
610 | between C<prev> and C<attr> is what triggered the callback. |
|
|
611 | |
|
|
612 | If you did something to the filesystem object and do not want to trigger |
|
|
613 | yet another change, you can call C<stat> to update EV's idea of what the |
|
|
614 | current attributes are. |
|
|
615 | |
581 | =item $w->set ($path, $interval) |
616 | =item $w->set ($path, $interval) |
582 | |
617 | |
583 | Reconfigures the watcher, see the constructor above for details. Can be |
618 | Reconfigures the watcher, see the constructor above for details. Can be |
584 | called at any time. |
619 | called at any time. |
585 | |
620 | |