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 2024/11/15 13:50:00 UTC

[jira] [Commented] (IO-857) PathUtils.cleanDirectory method does not erase subdirectories

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

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

Hello [~ydmitrya]

I think the semantics of "clean" is "delete files but not directories" such that cleaning a directory leaves you with a directory tree without any files.

PathUtils does this correctly but FileUtils does not.

So I think the bug is that FileUtils "clean" does too much deleting. I'm not sure if this is a regression or if FileUtils has always behaved this way.



> PathUtils.cleanDirectory method does not erase subdirectories
> -------------------------------------------------------------
>
>                 Key: IO-857
>                 URL: https://issues.apache.org/jira/browse/IO-857
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.16.1
>            Reporter: Dmitry
>            Priority: Minor
>
> The PathUtils.cleanDirectory method does not erase subdirectories. Only the files in them. The FileUtils.cleanDirectory method erases everything except the directory itself, and this is the expected behavior.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)