Ant的焦油任务可以设置即使任务是在其他平台上使用Linux的文件权限? [英] Can Ant's tar task set a Linux file permission even when the task is used on other platforms?

查看:206
本文介绍了Ant的焦油任务可以设置即使任务是在其他平台上使用Linux的文件权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Ant 1.7开始,TarFileSet可这似乎使得在tar归档文件权限的修改。

Starting with Ant 1.7, the TarFileSet is available which seems to allow file permission modifications in the tar archive.

此功能的工作平台无关的,这样我可以例如在Windows上创建和脚本文件在此存档tar文件设置执行权限,如果该文件是在Linux上解压缩,这将有这个标志?

Does this feature work platform-independent, so that I can for example create a tar file on Windows and set execution permissions for script files in this archive which will have this flag if the file is unpacked on Linux?

推荐答案

使用的 tarfileset ,使用 FILEMODE dirmode 属性。创建tar归档的时候,即使是在Windows上工作。

Yes, you can set permissions using tarfileset, using the filemode and dirmode attributes. This works when creating tar archives, even on windows.

相反烦人虽然,解压任务做的支持,你可能想反向操作:

Rather annoyingly though, the untar task does not support the reverse operation that you might want:

文件权限将无法恢复
  在提取的文件。

File permissions will not be restored on extracted files.

但是如果你使用焦油-xf ,例如permisions恢复正常。

But the permisions are restored fine if you use tar -xf, for example.

这篇关于Ant的焦油任务可以设置即使任务是在其他平台上使用Linux的文件权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆