subfolder - Remove too deep folders in bash on OSX -


a program created folders recursively. deep, full path string length longer max (getconf arg_max), example: /a/b/c/a/b/c/a/b/c//a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c …… "sudo rm -fr /a" says "bad address".

how create script deal it? thanks,

interesting problem.

i guess create command line tool xcode (file -> new project -> command line tool, insert code, click "run" toolbar button).

int main(int argc, const char * argv[]) {   @autoreleasepool {      nsurl *url = [nsurl fileurlwithpath:@"/a/b/c/d/..."];      nserror *error = nil;     [[nsfilemanager defaultmanager] removeitematurl:url error:&error];     if (error) {       nslog(@"%@", error);     }    }    return 0; } 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -