Post

Replies

Boosts

Views

Activity

Reply to Unexpected crash when typing text into NSTextView
I commented out all the code in the NSTextView subclass so that I was left with only a few segments in the NSDocument subclass that were dealing with the textview, and it turns out that a method containing the line `textView.textStorage.addLayoutManager()` was called twice. Making sure that it is only called once solved the problem. Thanks for your input!
Dec ’19
Reply to Resolve bookmark created in iOS app in Share Extension
Sorry, I didn't know that clicking on the checkmark would mark your answer as the correct one (it looks more like a badge to show that your account is verified, so I was wondering where the link would bring me). Is it possible to revert this action? Anyway, what you suggest is exactly what I'm doing (except that I cannot use withSecurityScope since I'm on iOS), and it's not working.
Aug ’20
Reply to Getting inode number from URL
I'm building an app that makes periodic backups and would like to know what files have changed between two backups (in particular when a file has been renamed so that I can rename it as well on the backup drive instead of removing the old file and copying the new one over again), which as far as I understand is only possible by comparing the inode numbers.
Aug ’20
Reply to Getting inode number from URL
Thank you, I already filed FB8308273. The problem even when only using stat is that FileManager will already have been its own call to get the other attributes, so it's always approximately double the scan time. What is the difference between getdirentriesattr and getattrlistbulk? Are there any examples in Swift? I already tried using getattrlistbulk in the past, but could only find examples written in Objective-C which were quite difficult to translate to Swift.
Aug ’20
Reply to Getting inode number from URL
Thank you so much! Although I don't understand why you use a while loop inside getattrlistbulk2. Shouldn't it be like this:     func getattrlistbulk2(_ dirFD: CInt, _ attrListPtr: UnsafeMutablePointer<attrlist>, _ attrBuf: UnsafeMutableRawBufferPointer, _ options: UInt64) throws -> Int {         let result = getattrlistbulk(dirFD, attrListPtr, attrBuf.baseAddress!, attrBuf.count, 0)         if result >= 0 {             return Int(result)         }         let err = errno         if err != EINTR {             throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno), userInfo: nil)         }         return 0     }
Aug ’20