I'm trying to get my NSTask
to unzip a file for me. This works fine if the path has no spaces, but when it does, it can't find any of the files. I can't hardcode the "
signs because I'm storing the zip file in a temporary folder, which is assigned by the system.
Does anyone know how to achieve this?
Here's my code:
NSTask*task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/unzip"];
NSArray*arguments = [NSArray arrayWithObjects:zipPath,@"-d",path,nil];
[task setArguments:arguments];
[task launch];
[task release];