Collate snapshots

Pipelines v1.6

 

.* Example by TenFiftyTwo(c).

Home

 
.* The following pipeline collates the files generated by the pipelines:
.* Machine snapshot1.ppl and Machine snapshot2.ppl. The pipeline collates the
.* two files to determine if any files have been changed or deleted and which
.* files are new.
 
.* The pipeline illustrates the use of the Collate stage.
 
pipe (endchar ? comment //)
     // Read master input file.
     < &sysdrive:\Documents and Settings\&username\My Documents\snapshot1.txt
     | sort                       // COLLATE expects a sorted input.
     | c: collate                 // Find matches.
     | hole                       // Discard matching records.
     ?
     // Read detail input file.
     < &sysdrive:\Documents and Settings\&username\My Documents\snapshot2.txt
     | sort                       // COLLATE expects a sorted input.
     | c:                         // Define secondary streams for COLLATE.
     // Write missing files.
     | > &sysdrive:\Documents and Settings\&username\My Documents\missingfiles.txt
     ?
     c:                           // Define tertiary output for COLLATE.
     // Write new files.
     | > &sysdrive:\Documents and settings\&username\My Documents\newfiles.txt
     ?
     literal /Wait! Collating.../ // Console info message.
     | cons                       // Write it to the console.