ant调用chmod
来源:互联网 发布:淘宝首页设计欣赏 编辑:程序博客网 时间:2024/06/15 02:45
摘自ant用户手册 http://ant.apache.org/manual/Tasks/chmod.html
Description
Changes the permissions of a file or all files inside specified directories. Right now it has effect only under Unix or NonStop Kernel (Tandem). The permissions are also UNIX style, like the argument for the chmod command.
See the section on directory based tasks, on how the inclusion/exclusion of files works, and how to write patterns.
This task holds an implicit FileSet and supports all of FileSet's attributes and nested elements directly. More sets can be specified using nested <fileset>
or <dirset>
(since Apache Ant 1.6) elements.
Starting with Ant 1.6, this task also supports nested filelists.
Starting with Ant 1.7, this task supports arbitrary Resource Collections as nested elements.
By default this task will use a single invocation of the underlying chmod command. If you are working on a large number of files this may result in a command line that is too long for your operating system. If you encounter such problems, you should set the maxparallel attribute of this task to a non-zero value. The number to use highly depends on the length of your file names (the depth of your directory tree) and your operating system, so you'll have to experiment a little. POSIX recommends command line length limits of at least 4096 characters, this may give you an approximation for the number you could use as initial value for these experiments.
By default this task won't do anything unless it detects it is running on a Unix system. If you know for sure that you have a "chmod" executable on your PATH that is command line compatible with the Unix command, you can use the task's os attribute and set its value to your current os.
Parameters
AttributeDescriptionRequiredfilethe file or single directory of which the permissions must be changed.exactly one of the two or nested<fileset/list>
elements.dirthe directory which holds the files whose permissions must be changed.Note: for backwards compatibility reasons
<chmod dir="some-dir"/>
will only change the permissions on "some-dir" but not recurse into it, unless you also specify any patterns.permthe new permissions.Yesincludescomma- or space-separated list of patterns of files that must be included.Noexcludescomma- or space-separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted.Nodefaultexcludesindicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted.Noparallelprocess all specified files using a single chmod
command. Defaults to true.NotypeOne of file, dir or both. If set to file, only the permissions of plain files are going to be changed. If set to dir, only the directories are considered.Note: The type attribute does not apply to nested dirsets - dirsets always implicitly assume type to be dir.No, default is filemaxparallelLimit the amount of parallelism by passing at most this many sourcefiles at once. Set it to <= 0 for unlimited. Defaults to unlimited. Since Ant 1.6.NoverboseWhether to print a summary after execution or not. Defaults to
false
. Since Ant 1.6.Nooslist of Operating Systems on which the command may be executed.NoosfamilyOS family as used in the <os> condition.No - defaults to "unix"Examples
<chmod file="${dist}/start.sh" perm="ugo+rx"/>
makes the "start.sh" file readable and executable for anyone on a UNIX system.
<chmod file="${dist}/start.sh" perm="700"/>
makes the "start.sh" file readable, writable and executable only for the owner on a UNIX system.
<chmod dir="${dist}/bin" perm="ugo+rx" includes="**/*.sh"/>
makes all ".sh" files below ${dist}/bin
readable and executable for anyone on a UNIX system.
<chmod perm="g+w"> <fileset dir="shared/sources1"> <exclude name="**/trial/**"/> </fileset> <fileset refid="other.shared.sources"/></chmod>
makes all files below shared/sources1
(except those below any directory named trial) writable for members of the same group on a UNIX system. In addition all files belonging to a FileSet with id
other.shared.sources
get the same permissions.
<chmod perm="go-rwx" type="file"> <fileset dir="/web"> <include name="**/*.cgi"/> <include name="**/*.old"/> </fileset> <dirset dir="/web"> <include name="**/private_*"/> </dirset></chmod>
keeps non-owners from touching cgi scripts, files with a .old
extension or directories beginning with private_
. A directory ending in .old
or a file beginning with private_ would remain unaffected.
- ant调用chmod
- Ant Chmod命令详解
- chmod fchmod 系统调用
- chmod函数 系统调用
- Java 代码调用ANT
- Java 代码调用ANT
- ant调用bat脚本
- ant 调用子任务
- java 调用 ant
- Java 代码调用ANT
- ant调用 shell脚本
- Ant调用java类
- maven调用ant篇
- 调用 Ant 任务
- maven调用ant
- ant调用bat脚本
- chmod
- chmod
- 重构--改善既有代码的设计
- “撞错”体验
- 工作要有“做好”的态度
- ORACLE关于锁表查询的部分SQL
- Windows下安装OpenSSL+用openssl命令制作生成证书和自签名
- ant调用chmod
- WebConfig的httpHandlers无效解决处理
- 如何实现控件随对话框大小变化而自动调整大小和位置
- 四边形优化dp
- 数据库原理与设计 --上机指导册
- JPA注解 Java Persistence API
- Jquery_easyUI,多行合并,根据多列合并
- VirtualBox 创建com对象失败,解决方法
- Storm高级原语(五) — State in Trident