Document rewinddir() limitations
authorJan Dubois <jand@activestate.com>
Mon, 25 Oct 2010 23:43:51 +0000 (16:43 -0700)
committerJan Dubois <jand@activestate.com>
Mon, 25 Oct 2010 23:44:40 +0000 (16:44 -0700)
as well as the similar limitations of directory handles that
have been open while calling the fork() emulation on Windows.

pod/perlfork.pod
pod/perlport.pod

index 0ff6876..c09433f 100644 (file)
@@ -187,6 +187,19 @@ is suggested instead.  C<_exit()> is available in Perl through the
 C<POSIX> module.  Please consult your system's manpages for more information
 on this.
 
+=item Open directory handles
+
+Perl will completely read from all open directory handles until they
+reach the end of the stream.  It will then seekdir() back to the
+original location and all future readdir() requests will be fulfilled
+from the cache buffer.  That means that neither directory handle held
+by the parent process nor the one held by the child process will see
+any changes made to the directory after the fork() call.
+
+Note that rewinddir() has a similar limitation on Windows and will not
+force readdir() to read the directory again either.  Only a newly
+opened directory handle will reflect changes to the directory.
+
 =item Forking pipe open() not yet implemented
 
 The C<open(FOO, "|-")> and C<open(BAR, "-|")> constructs are not yet
index 06b1684..4f5985f 100644 (file)
@@ -1868,6 +1868,12 @@ Not implemented. (Win32, VMS, S<RISC OS>)
 
 Can't move directories between directories on different logical volumes. (Win32)
 
+=item rewinddir
+
+Will not cause readdir() to re-read the directory stream.  The entries
+already read before the rewinddir() call will just be returned again
+from a cache buffer. (Win32)
+
 =item select
 
 Only implemented on sockets. (Win32, VMS)