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.