Post

Replies

Boosts

Views

Activity

Reply to filecopy fails with errno 34 "Result too large" when copying from NAS
Thanks for all the details and the funny anecdote. I'll ask the user to run the cp command, but they told me they have some other work to do at the moment and need a break. In the meantime, since you said it's a SMB issue, is there a way I can reproduce the "Result too large" myself? Setting a large resource fork like mentioned in that Stackoverflow post causes the mentioned error "Argument list too long". Using the Terminal command cat file > file/..namedfork/rsrc like suggested by the first answer in that post to set the file itself as a resource fork of itself works (listing the extended attributes with ls -l@ file shows com.apple.ResourceFork 34669586 for my 34 MB test file), but calling copyfile as in the code I posted in my first post still works, even when the destination is on a FAT volume connected via SMB. When calling fsetxattr as in the code below, I can only set a custom attribute named "asdf", but when using "com.apple.ResourceFork" the function doesn't seem to do anything. let f = open(path, O_RDWR) if f < 0 { throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno)) } var buf = UnsafeMutableRawPointer.allocate(byteCount: 4, alignment: 4) var r = fsetxattr(f, "asdf", &buf, 4, 0, 0) if r != 0 { throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno)) } r = close(f) if r != 0 { throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno)) } Output of ls -l@ file: asdf 4 com.apple.FinderInfo 32 com.apple.ResourceFork 34669586 com.apple.quarantine 57
Topic: App & System Services SubTopic: Core OS Tags:
1d
Reply to filecopy fails with errno 34 "Result too large" when copying from NAS
Sorry for the confusion, and you assumed correctly that copying in the Finder works, but I actually meant something else. What I meant was this: a user of my app reported that when my app copies files from a QNAP NAS to a folder on their Mac, they get the error "Result too large". When the app copies the same files from the Desktop folder, it works. Copying the files with the Finder, regardless their source location, works as well. From what the user told me, the issue only happens with some files. I actually asked them to narrow the issue down as much as possible and they found a folder with a single file, and copying that folder always causes that error. Interestingly, the destination file is actually created but has a much smaller size than the source: 250 KB instead of 34 MB. The user also shared that file as a zip archive on Dropbox with me. I ran the ls -l@ command on it to see its extended attributes and their size, the output was: com.apple.FinderInfo 32 com.apple.ResourceFork 286 com.apple.quarantine 57 Could com.apple.ResourceFork be the culprit? It doesn't seem to be exceedingly large to me, but maybe zipping a file doesn't correctly preserve extended attributes. Should I ask the user to run this command on their Mac? I also found this Stackoverflow post from 13 years ago which sounds like it could be the same issue, although they were trying to copy the extended attributes with xattr, not with filecopy: https://stackoverflow.com/questions/13533796/copy-mac-com-apple-resourcefork-extended-attribute-causing-argument-list-too-lo I created FB21805212.
Topic: App & System Services SubTopic: Core OS Tags:
2d
Reply to SpriteKit scene used as SCNView.overlaySKScene crashes due to SKShapeNode
Ok, so just to make things clear, is it expected that whenever I want to change the SpriteKit scene and also avoid concurrently accessing objects that may be changed in the current thread, I have to queue the SpriteKit changes by capturing all the needed state? It's just surprising to me that this is needed when SpriteKit is used as an overlay in SceneKit, but when running SpriteKit alone, it doesn't seem to be needed. I filed at least one feedback recently about crashes happening only when SpriteKit is used as SCNView.overlaySKScene. Is it expected that one has to use this... boilerplate code when embedded in SceneKit? Couldn't one do without it by simply overlaying a SkView on top of SCNView? class SceneController { private var shapeNode: SKShapeNode! func main() { let shapePath = CGPath(rect: CGRect(x: 0, y: 0, width: 10, height: 10), transform: nil) GameViewController.shared.updateSpriteKit { [shapeNode, shapePath] in shapeNode!.path = shapePath shapeNode!.fillColor = .systemRed } } } class GameViewController: NSObject, SKSceneDelegate { static let shared = GameViewController() private var skQueue = (queue: DispatchQueue(label: "skQueue", qos: .userInteractive), updates: [() -> Void]()) override func loadView() { let overlay = SKScene() overlay.delegate = self } func updateSpriteKit(_ block: @escaping () -> Void) { skQueue.queue.async { [self] in skQueue.updates.append(block) } } func update(_ currentTime: TimeInterval, for scene: SKScene) { skQueue.queue.sync { for block in skQueue.updates { block() } skQueue.updates.removeAll() } } }
Topic: Graphics & Games SubTopic: SpriteKit Tags:
3d
Reply to App Store doesn't display English among available languages for my new app
I figured it out. It seems that when all English strings are provided via NSLocalizedString's value argument, en.lproj is not created. In fact, when mixing localized strings with and without default values, only those that have no default value are included in the final app's en.lproj/Localizable.strings. Still, when running the app, the default value is correctly presented, so I guess since it's not in the strings file it is hard-coded in the executable. Maybe I'm not supposed to use the value argument this way? Should I instead cut all the default values and insert them manually in the string catalog? I was already considering to move all English values for my other projects from the string catalog to the source code so that I directly know what a localized string's contents are, but I'm happy now I didn't do that yet. I created FB21733395.
1w