You need to trigger the Input/output error - https://github.com/osxfuse/osxfuse/issues/45 first. This can be achieved with ifuse - https://github.com/libimobiledevice/ifuse and connecting an iOS device:
brew install ifuse
mkdir iphone
ifuse iphone
Now disconnecting the iOS device will result in the "Input/output error".
This is the output when running the above code in Xcode 12.4:
content directory contents
error Error Domain=NSCocoaErrorDomain Code=256 "The file “mount” couldn’t be opened." UserInfo={NSURL=file:///Users/user/mount, NSFilePath=/Users/user/mount, NSUnderlyingError=0x600002b69d10 {Error Domain=NSPOSIXErrorDomain Code=5 "Input/output error"}}
error Error Domain=NSCocoaErrorDomain Code=256 "The file “mount” couldn’t be opened." UserInfo={NSURL=file:///Users/user/mount, NSFilePath=/Users/user/mount, NSUnderlyingError=0x600002b6e0a0 {Error Domain=NSPOSIXErrorDomain Code=5 "Input/output error"}}
Topic:
Programming Languages
SubTopic:
Swift
Tags: