Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use NSFileManager interface for DMG unarchive only for 10.7+. #183

Merged
merged 1 commit into from

2 participants

@sinbad

On 10.6, [NSFileManager copyItemAtPath:toPath:error:] can fail with "Argument list too long" if the app bundle contains too many files. The switch to NSFileManager was only required for 10.7 anyway, 10.6 always worked fine.

For background info, you might want to check this out: https://jira.atlassian.com/browse/SRCTREE-1066

@sinbad sinbad Use NSFileManager interface for DMG unarchive only for 10.7+. On 10.6…
…, [NSFileManager copyItemAtPath:toPath:error:] can fail with "Argument list too long" if the app bundle contains too many files.

The switch to NSFileManager was only required for 10.7 anyway, 10.6 always worked fine.
91ac917
@andymatuschak andymatuschak merged commit 118f3c5 into from
@andymatuschak

Excellent; thank you. I'm sorry this caused so much trouble!

@sinbad

A small price to pay for such an excellent library :) Thanks for accepting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 28, 2012
  1. @sinbad

    Use NSFileManager interface for DMG unarchive only for 10.7+. On 10.6…

    sinbad authored
    …, [NSFileManager copyItemAtPath:toPath:error:] can fail with "Argument list too long" if the app bundle contains too many files.
    
    The switch to NSFileManager was only required for 10.7 anyway, 10.6 always worked fine.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 SUDiskImageUnarchiver.m
View
6 SUDiskImageUnarchiver.m
@@ -65,8 +65,8 @@ - (void)extractDMG
mountedSuccessfully = YES;
// Now that we've mounted it, we need to copy out its contents.
- if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) {
- // On 10.6 and later we don't want to use the File Manager API and instead want to use NSFileManager (fixes #827357).
+ if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) {
+ // On 10.7 and later we don't want to use the File Manager API and instead want to use NSFileManager (fixes #827357).
NSFileManager *manager = [[[NSFileManager alloc] init] autorelease];
NSError *error = nil;
NSArray *contents = [manager contentsOfDirectoryAtPath:mountPoint error:&error];
@@ -91,7 +91,7 @@ - (void)extractDMG
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
{
- SULog(@"Couldn't copy item: %@", error);
+ SULog(@"Couldn't copy item: %@ : %@", error, error.userInfo ? error.userInfo : @"");
goto reportError;
}
}
Something went wrong with that request. Please try again.