Scripting API

Scripting API

Trash

Class in Abyss.Core, from Abyss.Core.

The platform's trash: the Recycle Bin on Windows, the Trash elsewhere. What the editor deletes goes there rather than being deleted for good.

public static class Trash

Remarks

The engine's, not .NET's, because .NET has none: a file is deleted or it is not. The engine asks the platform the way its own file manager does, which is where the file can be put back from — see abyss_core::recycle for how, on each platform.

It waits for the platform, which for a folder of thousands of files is a while, on a thread the engine starts for the call. The caller waits too.

Properties

Name

public static string Name { get; }

What the platform calls its trash, as its file manager shows it.

Methods

Put

public static void Put(string path)

Moves a file or a folder, and everything in it, to the platform's trash.

Parameters

  • path: A whole path; a relative one is refused rather than guessed at.

Exceptions

  • IOException: Nothing is there, or the platform refused — a file another program has open, a drive with no trash whose warning was answered no. Nothing was deleted, and the message says why.
  • AbyssException: In a game's executable, which is built without what only the editor does (AbyssStatus.NotInBuiltGame).