You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem here is that this old method will raise an exception in case of an error, especially if the device runs out of disk space:
If the receiver is a file, writing takes place at the file pointer’s current position. After it writes the data, the method advances the file pointer by the number of bytes written. **This method raises an exception if the file descriptor is closed or is not valid, if the receiver represents an unconnected pipe or socket endpoint, if no free space is left on the file system, or if any other writing error occurs.
Using the newerwriteData:error: selector would return an error instead of causing an exception.
The text was updated successfully, but these errors were encountered:
I'm working on creating a modernized NSFileHandle+ARKAdditions in dfed/CacheAdvance#1, though I'm not sure if the current owners of this library would want to introduce that dependency.
One complication (which I haven't yet solved in CacheAdvance) is that the new methods are iOS 13+, so we'd need to continue using the old methods in iOS 12, though we could wrap the old methods and have them return an error (or throw in Swift).
Sounds great! The problem for this one in particular is that it runs asynchronous on it's own queue, so you can't handle the exception or a return error. A low hanging fruit here would be to just ignore the error with the new api.
There are several calls to NSFileHandle's writeData in
NSFileHandle+ARKAdditions.m
which is deprecated.The problem here is that this old method will raise an exception in case of an error, especially if the device runs out of disk space:
Using the newer
writeData:error:
selector would return an error instead of causing an exception.The text was updated successfully, but these errors were encountered: