Nucleus handler tools › Docs › .NET (System.*)
System
Open in the workbench (search, and try it in a handler)
Files, folders, paths and the environment, through .NET.
System.Environment.GetEnvironmentVariable— An environment variable, e.g. "APPDATA", or null if it is not set.System.Environment.MachineName· string — The computer's name.System.Environment.UserName· string — The Windows user name of whoever runs Nucleus.System.IO.Directory.CreateDirectory— Creates the folder and any missing parent folders. Nothing happens if it already exists.System.IO.Directory.Delete— Deletes a folder. Without recursive (or with false) the folder must be empty.System.IO.Directory.Exists— Whether the folder exists.System.IO.Directory.GetDirectories— Full paths of the folders in a folder, optionally matching a pattern.System.IO.Directory.GetFiles— Full paths of the files in a folder, optionally matching a pattern like ".ini".System.IO.Directory.Move— Moves or renames a folder.System.IO.File.AppendAllText— Adds the string to the end of the file (creates the file if needed).System.IO.File.Copy— Copies a file. With overwrite false (or left out) it throws if the destination exists, which ends the session inside Game.Play.System.IO.File.Delete— Deletes a file. No error if the file doesn't exist (its folder must); throws if it's in use or read-only.System.IO.File.Exists— Whether the file exists. false for a folder.System.IO.File.GetAttributes— The file's attributes, e.g. System.IO.FileAttributes.ReadOnly.System.IO.File.Move— Moves or renames a file. Throws if the destination exists.System.IO.File.ReadAllLines— The file as a list of lines.System.IO.File.ReadAllText— The whole file as one string.System.IO.File.SetAttributes— Sets the file's attributes, e.g. System.IO.FileAttributes.Normal to clear read-only.System.IO.File.WriteAllLines— Writes the lines to the file, replacing what was there.System.IO.File.WriteAllText— Writes the string to the file, replacing what was there (creates the file if needed).System.IO.Path.ChangeExtension— The path with another extension, e.g. ".bak".System.IO.Path.Combine— Joins path parts with , e.g. System.IO.Path.Combine(Game.Folder, "config.ini").System.IO.Path.GetDirectoryName— The folder part: C:ab.ini → C:a.System.IO.Path.GetExtension— The extension with its dot: C:ab.ini → .ini.System.IO.Path.GetFileName— The file name with its extension: C:ab.ini → b.ini.System.IO.Path.GetFileNameWithoutExtension— The file name without its extension: C:ab.ini → b.System.Threading.Thread.Sleep— Waits this many milliseconds. Nucleus waits with it, so keep it short.