diff options
Diffstat (limited to 'platform/osx/os_osx.mm')
-rw-r--r-- | platform/osx/os_osx.mm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 16bef349dc..6502001100 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1910,6 +1910,19 @@ int OS_OSX::get_power_percent_left() { return power_manager->get_power_percent_left(); } +Error OS_OSX::move_to_trash(const String &p_path) { + NSFileManager *fm = [NSFileManager defaultManager]; + NSURL *url = [NSURL fileURLWithPath:@(p_path.utf8().get_data())]; + NSError *err; + + if (![fm trashItemAtURL:url resultingItemURL:nil error:&err]) { + ERR_PRINTS("trashItemAtURL error: " + String(err.localizedDescription.UTF8String)); + return FAILED; + } + + return OK; +} + OS_OSX *OS_OSX::singleton = NULL; OS_OSX::OS_OSX() { |