HI,
is there something like "safe-mode" in Mathematica. I would like to run and automatically test several projects (students work) and I would like to disable all low-level functions accessing the file system and operating system. (Something like: "math --safe-mode -script myProgram.m")
One solution could be (I probably missed some functions):
ClearAttributes[{Run, RunThrough, CopyFile, DeleteFile, RenameFile,
CreateDirectory, CopyDirectory, DeleteDirectory, RenameDirectory,
OpenRead, OpenWrite, Read, Write, BinaryRead,
BinaryWrite}, Protected]
Run[___] := $Failed;
RunThrough[___] := $Failed;
CopyFile[___] := $Failed;
DeleteFile[___] := $Failed;
RenameFile[___] := $Failed;
CreateDirectory[___] := $Failed;
CopyDirectory[___] := $Failed;
DeleteDirectory[___] := $Failed;
RenameDirectory[___] := $Failed;
OpenRead[___] := $Failed;
OpenWrite[___] := $Failed;
Read[___] := $Failed;
Write[___] := $Failed;
BinaryRead[___] := $Failed;
BinaryWrite[___] := $Failed;
SetAttributes[{Run, RunThrough, CopyFile, DeleteFile, RenameFile,
CreateDirectory, CopyDirectory, DeleteDirectory, RenameDirectory,
OpenRead, OpenWrite, Read, Write, BinaryRead,
BinaryWrite}, Protected]
Any ideas?
Zdenek