Hi Vinay, thanks for your reply! I am catching the SIGPIPE, however, the exception still occurs. What I have noticed is that the decrypted file is corrupted and the copy loop does not complete, it actually stops performing any operation in the middle of the process leaving the file in a 'middle' state. When the exception occurs the gpg subprocess taking care of the decryption process exits immeadtely. this is the actual process that is being terminated immediately provoking the exception
test+ 26724 26695 99 11:07 ? 00:00:03 gpg --status-fd 2 --no-tty --no-verbose --fixed-list-mode --batch --
If I keep the operation going without sending a termination signal in the middle of the decryption process the application acks to have received the termination signal, but still waits to complete all the rest of the tasks before exiting gracefully. it seems to me that something is happening within the copy process but cant seem to find a way how to fix this