-- Smash.mesa

DIRECTORY
  File,
  FileTypes,
  KernelFile,
  IO,
  ViewerIO,
  Volume;

Smash: PROGRAM IMPORTS File, KernelFile, IO, ViewerIO, Volume =

BEGIN

file: File.Capability ← KernelFile.GetNextFile[Volume.systemID, File.nullCapability];
out, in: IO.STREAM;
[in, out] ← ViewerIO.CreateViewerStreams[name: "Smash", editedStream: FALSE];
UNTIL file = File.nullCapability DO
  next: File.Capability ← KernelFile.GetNextFile[Volume.systemID, file];
  IF File.GetAttributes[file].type = FileTypes.tUntypedFile THEN {
    out.PutF["Size %g ", [cardinal[File.GetSize[file]]]];
    IF in.GetChar[] = 'y THEN File.Delete[file];
    out.PutChar['\N];
    };
  file ← next;
  ENDLOOP;

END.