Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-29 Thread Gary Gregory
Thank you Tres, I just approved the PR jobs on GitHub. Gary On Mon, Aug 29, 2022, 10:40 Tres Finocchiaro wrote: > https://github.com/apache/commons-io/pull/377 >

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-29 Thread Tres Finocchiaro
https://github.com/apache/commons-io/pull/377

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-29 Thread Tres Finocchiaro
PR submitted. I've left it in draft per our discussions. Since I am a first time contributor, it will need intervention before the PR tasks are executed. - tres.finocchi...@gmail.com On Sun, Aug 28, 2022 at 1:20 PM Gary Gregory wrote: > We can create a ticket later. If you want to create one

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-28 Thread Gary Gregory
We can create a ticket later. If you want to create one now, that's fine too. Gary On Sun, Aug 28, 2022, 12:21 Tres Finocchiaro wrote: > > > > Please create a PR on GitHub so we can see build results in all the OSs > and > > Java versions we test there. > > > > Sure thing. The instructions say

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-28 Thread Tres Finocchiaro
> > Please create a PR on GitHub so we can see build results in all the OSs and > Java versions we test there. > Sure thing. The instructions say to reference a JIRA ticket number in the subject line. Should I create a formal bug report first or is a standalone PR sufficient? >

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-28 Thread Gary Gregory
Hi Tres, Please create a PR on GitHub so we can see build results in all the OSs and Java versions we test there. Gary On Fri, Aug 26, 2022, 01:50 Tres Finocchiaro wrote: > Initial commit(s): > > https://github.com/apache/commons-io/compare/master...tresf:commons-io:attributes > >- It

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-25 Thread Tres Finocchiaro
Initial commit(s): https://github.com/apache/commons-io/compare/master...tresf:commons-io:attributes - It still needs human testing on many platforms (I plan to perform these) - Unit tests have been added (need to be human-verified before accepting them as passing) - I'd like to

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-22 Thread Tres Finocchiaro
> > > what I'd expect as a new user of Commons IO I think it's safe to say, at least on Windows, the default OS behavior is what 99% of people will want default in a copy utility; copying a file to a destination nearly always warrants the destination permissions, especially when the ACLs for

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-22 Thread Gary Gregory
On Sun, Aug 21, 2022 at 11:50 AM Tres Finocchiaro < tres.finocchi...@gmail.com> wrote: > Unix results have near identical regressions using the stackoverflow > snippet, but for > "/opt/MyApp" (Linux) and "/Applications/MyApp.app" (Mac) > > *Ubuntu

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-21 Thread Tres Finocchiaro
Unix results have near identical regressions using the stackoverflow snippet, but for "/opt/MyApp" (Linux) and "/Applications/MyApp.app" (Mac) *Ubuntu 22.04:* 2.8 and lower: - Files copied from $HOME/Desktop to /opt/MyApp *inherit target

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-21 Thread Tres Finocchiaro
I've pinpointed when this regression occurred, it was between 2.8.0 and 2.9.0. - (GOOD) 2.4, 2.5, 2.6, 2.7 and 2.8 properly inherit the destination permissions. - (BAD) 2.8, 2.9, 2.10 and 2.11 do not inherit the destination permissions. Scope of this issue: - *2005-2021 (16

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Gary Gregory
You're approach is fine. In this case it is better to talk it out here IMO, before writing code in a PR. I'm not sure it is possible to change the existing File-based API and have behavior that kinda matches across all Commons IO versions in a way that will make everyone happy. The good thing is

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Tres Finocchiaro
> > What about using an empty array as input to PathUtils.copyDirectory(Path, > Path, CopyOption...) ? Yes, as long as StandardCopyOptions.*REPLACE_EXISTING* is provided, which seems to mimic the former: PathUtils.copyDirectory(folder.toPath(), dest.toPath(), >

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Gary Gregory
You can always provide a PR on GitHub to see what a fix would look like. The hard parts are maintaining compatibility with the current version as opposed to an antique version and updating the tests. Going back to the 2.4 behavior will obviously cause people expecting the 2.11.0 behavior to

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Gary Gregory
Tres, Yeah, I/we got caught here in the desire to provide backward compatibility and update the implementation to NIO. You might want to also try the 2.12.0-SNAPSHOT from https://repository.apache.org/content/repositories/snapshots/commons-io/commons-io/2.12.0-SNAPSHOT/ What about using an empty

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Tres Finocchiaro
I've answered my own question on stackoverflow. I'm curious how the community feels about filing this as a bug. It's pretty big regression for those upgrading from 2.4 with Windows target deployments. - tres.finocchi...@gmail.com On Sat, Aug 20, 2022 at 3:16 PM Tres Finocchiaro wrote: >

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Tres Finocchiaro
Gary, Thanks again for your reply however COPY_ATTRIBUTES is the source of the problem, it's being added and wiping out the permissions. I've linked my suspicion as to why in my previous email. For now, I will toggle-off the preserveFileDate, which seems to be the only workaround for this

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Gary Gregory
Hello Tres, I think what you want is to call FileUtils.copyDirectory() or PathUtils.copyDirectory() with java.nio.file.StandardCopyOption.COPY_ATTRIBUTES. Gary On Sat, Aug 20, 2022 at 2:51 PM Tres Finocchiaro wrote: > > > > Use *org.apache.commons.io.FileUtils.copyFile(File, File, boolean, >

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Tres Finocchiaro
> > Under the covers it ends up calling *java.nio.file.Files.copy(Path, Path, > CopyOption...)*. Sure, but from what I'm reading, it's adding CopyOptions that no one asked for and is not in alignment with how NIO works, so this statement is a bit misleading. I think this is the problematic

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Tres Finocchiaro
> > Use *org.apache.commons.io.FileUtils.copyFile(File, File, boolean, > CopyOption...)* to exercise full control over what you want to do. > Thanks for the reply. >From my understanding, CopyOption supports one or more of three options: REPLACE_EXISTING, COPY_ATTRIBUTES, NOFOLLOW_LINKS, none of

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Gary Gregory
Under the covers it ends up calling *java.nio.file.Files.copy(Path, Path, CopyOption...)*. On Sat, Aug 20, 2022 at 2:30 PM Gary Gregory wrote: > Hello Tres, > > Use *org.apache.commons.io.FileUtils.copyFile(File, File, boolean, > CopyOption...)* to exercise full control over what you want to

Re: [io] Regression in FileUtils.copyDirectory() for Windows?

2022-08-20 Thread Gary Gregory
Hello Tres, Use *org.apache.commons.io.FileUtils.copyFile(File, File, boolean, CopyOption...)* to exercise full control over what you want to do. Gary On Sat, Aug 20, 2022 at 12:30 PM Tres Finocchiaro < tres.finocchi...@gmail.com> wrote: > Hi, > > I'm updating some dependent libraries and hit