You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2021/03/14 16:36:00 UTC

[jira] [Commented] (IO-721) FileUtils.copyDirectory() tries to set last modified on source dir after update to 2.8.0

    [ https://issues.apache.org/jira/browse/IO-721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17301195#comment-17301195 ] 

Gary D. Gregory commented on IO-721:
------------------------------------

A quick scan for the git master and 2.8.0 does not reveal an obvious issue.

May you please demonstrate your use case in a PR on GitHub? You can create a new class or append to one of the many {{FileUtils*TestCase}} classes.

> FileUtils.copyDirectory() tries to set last modified on source dir after update to 2.8.0
> ----------------------------------------------------------------------------------------
>
>                 Key: IO-721
>                 URL: https://issues.apache.org/jira/browse/IO-721
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.8.0
>         Environment: Ubuntu 20.04 LTS
> Groovy 3.0.x
> Java 11 (from Ubuntu packages)
>            Reporter: Dirk Heinrichs
>            Priority: Major
>
> A simple
> {code:java}
> FileUtils.copyDirectory(source, dest, glob) {code}
> works fine when using Commons-IO 2.7, but fails with
> {code:java}
> Caught: java.io.IOException: Failed setLastModified on /path/to/source
> java.io.IOException: Failed setLastModified on /path/to/source
>         at org.apache.commons.io.FileUtils.setLastModified(FileUtils.java:2561)
>         at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1361)
>         at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:733)
>         at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:659)
>         at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:606)
> {code}
> after update to 2.8.0. From reading the documentation, it's also my understanding that "setLastModified()" should be executed on "dest" to set the same modification time as "source", but *not* on "source".



--
This message was sent by Atlassian Jira
(v8.3.4#803005)