commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schulte (JIRA)" <>
Subject [jira] [Commented] (IO-502) Exceptions are suppressed incorrectly when copying files.
Date Mon, 25 Apr 2016 23:34:12 GMT


Christian Schulte commented on IO-502:

The 'close' method of 'FileOutputStream' translates to a call to OpenJDK's native [fileClose|]
method. That will call [JVM_Close|]
leading to the operating system's C libraries 'close' function getting called. Definitely
want any error that function returns to be propagated as an exception to the caller. It's
completely operating system dependent. On my system the manpage of close states:

     close() will fail if:

     [EBADF]            d is not an active descriptor.
     [EINTR]            An interrupt was received.
     [EIO]              An I/O error occurred while writing to the file system.

Not suppressing any of these errors silently should do. I think closing a channel obtained
from a stream will also close the stream internally. I do not know if that is specified behaviour
or just an implementation detail of e.g. OpenJDK.

> Exceptions are suppressed incorrectly when copying files.
> ---------------------------------------------------------
>                 Key: IO-502
>                 URL:
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>            Reporter: Christian Schulte
>            Priority: Critical
>         Attachments: IO-502.patch
> When copying files or directories, exceptions thrown on closing streams are suppressed
incorrectly and need to be propagated to the caller.

This message was sent by Atlassian JIRA

View raw message