开发者

While Copying plist to somewhere else filetype getting changed

I am interested in copying the plist from my application to somewhere in the folder. I am trying but that file's type getting changed Unix Executable file to Document Is there a way to programmatically copy the file without changing file type ?

Ca开发者_如何学运维n any body help me ?

Thanks in Advance


No I am not changing the name of file, i am copying file as it is to another location. I have java application which i am running on MAC os, and i am using following

            FileFilter filter = new FileFilter() {

                public boolean accept(File pathname) {
                   if (pathname.getAbsolutePath().indexOf(File.separator + "data") != -1) {
                        return false;
                    } else if (pathname.getAbsolutePath().indexOf(File.separator + "Logs") != -1) {
                        return false;
                    }
                        return true;
                    } 
            };

FileUtils.copyDirectory("source path", "destination path",filter );

While is tried manually copy-paste on mac for same file (plist) that is same as source file with Unix Executable file extension


Your OS may be using the execute bit to determine if the file is an executable vs. a document. Try changing the execute bit of the file...

chmod a+x {filename}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜