Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 8884 invoked from network); 9 Apr 2002 14:34:21 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 Apr 2002 14:34:21 -0000 Received: (qmail 16974 invoked by uid 97); 9 Apr 2002 14:34:19 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 16955 invoked by uid 97); 9 Apr 2002 14:34:18 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 16940 invoked by uid 50); 9 Apr 2002 14:34:17 -0000 Date: 9 Apr 2002 14:34:17 -0000 Message-ID: <20020409143417.16939.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: ant-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 7780] - Please consider allowing the specification of directory permission for the tar task. X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . 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: For additional commands, e-mail: