Unfortunately in the world of Java where you have applications (or servlets
in this case) which can run on a variety of hardware and in a variety of
containers when you perform platform specific functions (such as changing
file permissions or ownerships) there isn't always a Java centric way of
doing things. You must at times cater to the platform. This is commonly
seen when querying the system properties as to if a platform uses / or \ in
it's path.
The best and most platform portability centric way is to ask the system what
it's specifics are and generate code for each one. I haven't looked at all
the ant code yet but I would believe that either the Mac OS isn't supported
for this method or it is taken care of else where.
So ironically, to be platform independent you sometimes have to code for
specific platforms from the beginning. Of course this only makes your code
platform independent for all known (and implemented) platforms at the time.
The instant a new platform comes out that does not adhear to one of your
coding standards your code breaks. But sometimes this is the only solution.
Matt
On Thu, 12 Jul 2001, Marco
Trevisan wrote:
> A very quick look at Chmod.class in ant.jar of
> tomcat 3.2.1 distribution (reporting 1.3alpha in version.txt)
> brought me to the following line (copied by hand):
> protected boolean isValidOs() {
> return System.getProperty("path.separator").equals(":") &&
> (!System.getProperty("os.name").startsWith("Mac") ||
> System.getProperty("os.name").endWith("X")) && super.isValidOs();
> }
>
> Just a question pops up in my mind:
> what about portability ?
>
> Marco
>
> ----- Original Message -----
> From: "Mark Galbreath" <[EMAIL PROTECTED]>
> > There IS a way to do it, because the ANT utility can take a chmod
> parameter
> > from the build.xml file and create the files with the specific permissions
> > you need. The source code for ANT is at jakarta.apache.org/ant and you
> can
> > look for the specific method that does this. Actually, if you find it,
> post
> > it here - it would be a really useful bean!
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html