executable bit is lost on files when using directoryCopy() on binaries

Description

Test this on a *nix machine. Create a file and use chmod to mark it as executable

1 2 touch foo chmod a+x foo

Then use Lucee's directoryCopy() function to copy the contents of that folder to another folder.

1 directoryCopy( source, target, true );

If you look at the foo file on the file system, you'll see it is no longer executable. This is causing big issues in CommandBox where users may package executable binaries to be installed and the executable flags get dropped which makes the binaries non longer work once they're installed.

I have tested on Adobe CF 2016 and it DOES preserve the executable bits on the files as it should. Note, the java.nio.file.Files class has some nice helper methods to use here.

https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#setPosixFilePermissions(java.nio.file.Path,%20java.util.Set)

https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#getPosixFilePermissions(java.nio.file.Path,%20java.nio.file.LinkOption...)

Environment

None

Status

Assignee

Michael Offner

Reporter

Brad Wood

Labels

None

Sprint

None

Fix versions

Priority

Critical
Configure