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
Post a Comment