Skip removing FIFOs from device #528
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
That operation always fails with error
0xc
anyway.To distinguish regular files from FIFO, new
READ_DIR_FIFO
is added toread_dir_cb_reason
. The behavior of other operations regarding FIFOsis left the same by supporting the new reason.
(Another implementation could be not to extend the
read_dir_cb_reason
and add another flag to
read_dir
'scallback
, but that would allowmeaningless cases, such as
reason = READ_DIR_AFTER_DIR, is_fifo = true
.The ideal implementation would be to extent the
READ_DIR_FILE
enumcase with a flag (i.e.,
READ_DIR_FILE(is_fifo = true)
), but that isnot supported in Objective-C.)
The fix is to skip removing FIFOs had a side-effect of failing to remove
a directory where a skipped file is because the directory is not empty.
The change here is to continue removing files after errors, which is
also helpful in cases when
ios-deploy
fails to remove/Documents/
("Error 0xa: You do not have permission."), but still needs to continue
removing what it can from
/Library/
.Fixes #518.
Error messages
I've also stumbled upon a fix for error messages (I can extract it to a new PR if necessary):
This makes
ios-deploy
print error messages for known error codes sothat the console log looks like:
instead of:
The fix is to create an error code from the input
error
to matchwhat's defined in
errorcode_to_id
(for some reason, the errors areOR
'd with0xe8000000
). This change is taken from theSDMMobileDevice
project, which is the source for the error codes.Sample output now