ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 7780] - Please consider allowing the specification of directory permission for the tar task.
Date Tue, 09 Apr 2002 14:34:17 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7780>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7780

Please consider allowing the specification of directory permission for the tar task.

acl1@notes.ntrs.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |



------- Additional Comments From acl1@notes.ntrs.com  2002-04-09 14:34 -------
The tar file that I need to come up with must have directory permission 750 and
file permission 640.  Since the tarfileset has only one mode specification, it
is impossible to do this.  So I modified tar.java to suit my requirement.  The
tarfileset class is defined inside tar.java and it has been modified to include
the following two attributes in place of the original mode attribute:        

private int fileMode = 0100644;
private int dirMode = 040755;

In place of the original methods for the mode attribute, the following methods
have been substituted:

        public void setFileMode(String octalString) {
            this.fileMode = 0100000 | Integer.parseInt(octalString, 8);
        }
            
        public int getFileMode() {
            return fileMode;
        }
        
        public void setDirMode(String octalString) {
            this.dirMode = 040000 | Integer.parseInt(octalString, 8);
        }
            
        public int getDirMode() {
            return dirMode;
        }
        
Then in the tarfile() method in the tar class, the following modification has
been made:

    protected void tarFile(File file, TarOutputStream tOut, String vPath,
                           TarFileSet tarFileSet)
        throws IOException
    {
        .
        .
        .

(removed)    if (!file.isDirectory()) {
(removed)        te.setSize(file.length());
(removed)        te.setMode(tarFileSet.getMode());
(removed)    } 

(added)      if (!file.isDirectory()) {
(added)          te.setSize(file.length());
(added)          te.setMode(tarFileSet.getFileMode());
(added)      } 
(added)      else {
(added)          te.setMode(tarFileSet.getDirMode());
(added)      }
        .
        .
        .

    }

With the new modification I can specify a 'dirmode' for the mode of directories
and a 'filemode' for the mode of files within the tar file.  This provides more
flexibility for the tar task.

Any further consideration for this issue will be greatly appreciated.  Thanks.

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message