NSFileManager copyItemAtPath:toPath:error: error on 10.6

  • Hi, I am having a problem with using NSFileManager's copyItemAtPath:toPath:error: in OSX 10.6 - this does not cause a problem on 10.7. The code being executed is part of the current version of Sparkle. The following logs show items successfully copied:

    copy from: /Volumes/E010E195-C798-4CF5-9D87-F29B33E4481F/.com.apple.timemachine.supported to: /Users/gideon/Library/Application Support/NovaMind 5/NovaMind 5 5.3.0/.com.apple.timemachine.supported
    copy from: /Volumes/E010E195-C798-4CF5-9D87-F29B33E4481F/.DS_Store to: /Users/gideon/Library/Application Support/NovaMind 5/NovaMind 5 5.3.0/.DS_Store
    copy from: /Volumes/E010E195-C798-4CF5-9D87-F29B33E4481F/.fseventsd to: /Users/gideon/Library/Application Support/NovaMind 5/NovaMind 5 5.3.0/.fseventsd
    copy from: /Volumes/E010E195-C798-4CF5-9D87-F29B33E4481F/.vbt5 to:/Users/gideon/Library/Application Support/NovaMind 5/NovaMind 5 5.3.0/.vbt5
    copy from: /Volumes/E010E195-C798-4CF5-9D87-F29B33E4481F/Applications to:/Users/gideon/Library/Application Support/NovaMind 5/NovaMind 5 5.3.0/Applications
    copy from: /Volumes/E010E195-C798-4CF5-9D87-F29B33E4481F/DMG_background.png to:/Users/gideon/Library/Application Support/NovaMind 5/NovaMind 5 5.3.0/DMG_background.png

    Then it gets to this one:
    copy from: /Volumes/E010E195-C798-4CF5-9D87-F29B33E4481F/NovaMind5.app to: /Users/gideon/Library/Application Support/NovaMind 5/NovaMind 5 5.3.0/NovaMind5.app

    which fails with this error:
    Error Domain=NSPOSIXErrorDomain Code=7 UserInfo=0x11bdc61f0 "The operation couldn’t be completed. Argument list too long"

    I have used previous versions of Sparkle with no issues, and have not changed my method of producing the disk image that is being installed. I'm not clear as to what the argument list is that could be too long.

    Any suggestions as to what could be going wrong?

    TIA

    Gideon
  • OK, I have looked at the user info dictionary of the error, and see the file that is causing the problem:

    UserInfo: {
        NSDestinationFilePath = "/Users/gideon/Library/Application Support/NovaMind 5/NovaMind 5 5.3.0/NovaMind5.app/Contents/Resources/ruby/lib/libruby-static.a";
        NSFilePath = "/Volumes/DEDB91B6-6EA0-4AE2-B038-94056AD36D54/NovaMind5.app/Contents/Resources/ruby/lib/libruby-static.a";
        NSUserStringVariant = Copy;
    }

    Using the file command, I get the following information:
    libruby-static.a: Mach-O universal binary with 1 architecture
    libruby-static.a (for architecture i386):    current ar archive random library

    And ls -l@ tells me:

    -rw-r--r--@ 1 gideon  staff  8359196 15 May 11:13 libruby-static.a
    com.apple.cs.CodeDirectory    123
    com.apple.cs.CodeRequirements      12
    com.apple.cs.CodeSignature    4371

    I have not changed anything about this file or how it is processed during builds, since the last version that worked.

    I see that the old version of Sparkle I was using  used to use FSCopyObjectSync to copy the files, and that seemed to work, so I have just put something in so that if using 10.7 or later, it uses NSFileManager, and on 10.6 it uses FSCopyObjectSync - at least that gets me something that works quickly, but if anyone knows why this might fail when using NSFileManager's method on 10.6, I'd be keen to know...

    Regards

    Gideon
previous month may 2012 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today