(* SP1 Aufgabe "Creeper" in Standard ML * $Id: creeper.sml,v 1.3 2024/07/09 18:46:10 oj14ozun Exp $ * https://wwwcip.cs.fau.de/~oj14ozun/src+etc/creeper.sml *) open OS.FileSys; open OS.Path; open TextIO; fun visit path = (print (path ^ "\n"); if isDir path andalso not(isLink path) then let val ds = openDir path in iterate path ds; closeDir ds end else ()) handle (OS.SysErr (msg, _)) => output (stdErr, path ^ ": " ^ msg ^ "\n") and iterate path ds = case readDir ds of SOME name => (visit (concat (path, name)); iterate path ds) | NONE => (); List.app visit (CommandLine.arguments ());