An OS-independent version of the original OSUtils.m3, which lives on in Postcard, and much of whose implementation was taken from Ted Wobber's FileSys.m3
MODULE; IMPORT Atom, AtomList, FS, OSError; PROCEDURE OSUtils Delete (path: TEXT) RAISES {FileError} = BEGIN TRY FS.DeleteFile (path); EXCEPT OSError.E (e) => RAISE FileError (AtomListToText (e)); END; END Delete; PROCEDUREMakeDir (path: TEXT) RAISES {FileError} = BEGIN TRY FS.CreateDirectory (path); EXCEPT OSError.E (e) => RAISE FileError (AtomListToText (e)); END; END MakeDir; PROCEDUREAtomListToText (e: AtomList.T): TEXT = VAR msg := ""; BEGIN FOR i := 0 TO (AtomList.Length (e) - 1) DO msg := msg & Atom.ToText (AtomList.Nth (e, i)) & " "; END; RETURN msg; END AtomListToText; BEGIN END OSUtils.