1 using MoonSharp.Interpreter.Platforms;
2 using MoonSharp.Interpreter;
13 mode = mode.Replace(
"b",
"");
17 else if (mode ==
"r+")
18 return FileMode.OpenOrCreate;
20 return FileMode.Create;
21 else if (mode ==
"w+")
22 return FileMode.Truncate;
24 return FileMode.Append;
29 mode = mode.Replace(
"b",
"");
32 return FileAccess.Read;
33 else if (mode ==
"r+")
34 return FileAccess.ReadWrite;
36 return FileAccess.ReadWrite;
37 else if (mode ==
"w+")
38 return FileAccess.ReadWrite;
40 return FileAccess.Write;
53 public override Stream
IO_OpenFile(Script script,
string filename, Encoding encoding,
string mode)
65 case StandardFileType.StdIn:
66 return Console.OpenStandardInput();
67 case StandardFileType.StdOut:
68 return Console.OpenStandardOutput();
69 case StandardFileType.StdErr:
70 return Console.OpenStandardError();
72 throw new ArgumentException(
"type");
78 return "LocalMods/temp.txt";
83 throw new ScriptRuntimeException(
"usage of os.exit is not allowed.");
103 throw new ScriptRuntimeException(
"usage of os.execute is not allowed.");
113 System.Diagnostics.Debug.WriteLine(content);
static void Move(string path, string destination)
static bool IsPathAllowedLuaException(string path, bool write=true)
static void Delete(string path)
static bool Exists(string path)