I need to move directory with all content to trash.
I find in documentation NSWorkspaceRecycleOperation
operation, and wrote this code:
NSString *path = [NSString stringWithString:@"/Users/test/Desktop/test"];
NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation
source:path
destination:@""
files:dirContents
tag:nil];
It move to trash all contents, but don't move directory itself. So, how can i do this?