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

Bruno P. Kinoshita commented on IO-491:
---------------------------------------

Couldn't reproduce it with my current environment (below).

{noformat}
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 
2015-11-11T05:41:47+13:00)
Maven home: /home/kinow/Development/java/apache-maven-3.3.9
Java version: 1.8.0_66, vendor: Oracle Corporation
Java home: /home/kinow/Development/java/jdk1.8.0_66/jre
Default locale: en_NZ, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-47-generic", arch: "amd64", family: "unix"

kinow@localhost:~$ uname -a
Linux localhost 3.19.0-47-generic #53~14.04.1-Ubuntu SMP Mon Jan 18 16:09:14 
UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
kinow@localhost:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
{noformat}

Created a folder ~/DIR1.app, with some content in it.

{noformat}
kinow@localhost:~$ mkdir ~/DIR1.app
kinow@localhost:~$ cd ~/DIR1.app
kinow@localhost:~/DIR1$ touch date.txt
kinow@localhost:~/DIR1$ date > date.txt
kinow@localhost:~/DIR1$ cat date.txt 
Mon Feb  1 20:23:11 NZDT 2016
kinow@localhost:~/DIR1$ md5sum date.txt 
3324a7961efd23aaa09dc3c6e79ee4c8  date.txt
{noformat}

And them copied it to another folder with the example provided, as follows.

{code}
    public static void main(String[] args) throws Exception {        
FileUtils.copyDirectoryToDirectory(FileUtils.getFile(System.getProperty("user.home")
 + "/DIR1.app"),
                FileUtils.getFile("/tmp/"));
    }
{code}

And the folder and file created were both correctly copied, with no corruption.

{noformat}
kinow@localhost:~/DIR1.app$ ls /tmp/DIR1.app/
date.txt
kinow@localhost:~/DIR1.app$ cat /tmp/DIR1.app/
kinow@localhost:~/DIR1.app$ cat /tmp/DIR1.app/date.txt 
Mon Feb  1 20:23:11 NZDT 2016
kinow@localhost:~/DIR1.app$ md5sum /tmp/DIR1.app/date.txt 
3324a7961efd23aaa09dc3c6e79ee4c8  /tmp/DIR1.app/date.txt
{noformat}

The ~/DIR1.app folder was created using the default umask and had the 
permission to 0755. But even after changing the mode to 0777, and repeating it, 
the code worked as expected.

Would be nice to have an attachment (.zip or .app maybe) and if someone with a 
Mac could test it too. It could be due to some other process using the file, or 
some other thing related to the reporter environment.

Hope that helps.

> Copying *.app corrupts the file
> -------------------------------
>
>                 Key: IO-491
>                 URL: https://issues.apache.org/jira/browse/IO-491
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Streams/Writers
>    Affects Versions: 2.4
>         Environment: Mac OS 10.11.2
>            Reporter: Akshay Raj Gollahalli
>            Priority: Blocker
>              Labels: patch
>             Fix For: 2.5
>
>
> Hi,
> When ever I try to copy a *.app to a folder, *.app corrupts completely. 
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to