| Extracted from Pike v7.8 release 866 at 2018-02-09.

[Top]
Filesystem
Filesystem.Traversion

# Class Filesystem.Traversion

Description

  Iterator object that traverses a directory tree and returns files as values and paths as indices. Example that uses the iterator to create a really simple sort of make:

Example

      object i=Filesystem.Traversion(".");
         foreach(i; string dir; string file) {
         	if(!has_suffix(file, ".c")) continue;
           file = dir+file;
           string ofile = file;
         	ofile[-1]='o';
         	object s=file_stat(ofile);
         	if(s && i->stat()->mtime<s->mtime) continue;
         	// compile file
         }