Safety Property: TarLimitCreatedFiles





property TarLimitCreatedFiles { 
   requires TrackCreatedFilesRecordArgsFileNames;
   check RFileSystem.openCreate (file: RFile) {
     if (RSystem.commandArgsContains ("-c")) {
       if (createdFiles > 1) {
         violation ("File create limit reached. " +
                    "Attempt to create more than 1 file. " +
                    "Creating " + file.getName () + ".");
       }
     } else if (!RSystem.commandArgsContains ("-x")) {
       violation ("Attempt to create a new file: " + file.getName ());
     }
   }
}

About this file

Naccio Home Page
David Evans
University of Virginia, Computer Science