you need compatible version of bsf to use script. > -----Original Message----- > From: Gareth Kelly [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 02, 2004 8:33 AM > To: 'Ant Users List' > Subject: RE: Ant Get FileSize using exec? > > > Using the below example I get this error: > > BUILD FAILED > /export/home/vssop/sparcs/build.xml:17: Could not create type > scriptdef due > to java.lang.NoClassDefFoundError: org/apache/bsf/BSFException > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 02 November 2004 13:26 > To: [EMAIL PROTECTED] > Subject: AW: Ant Get FileSize using exec? > > > I´ve converted the former <script> to 1.6. > > Jan > > > <project> > > <scriptdef name="getfs" language="javascript"> > <attribute name="file"/> > <attribute name="property"/> > <![CDATA[ > fileName = attributes.get("file"); > propName = attributes.get("property"); > > file = new java.io.File(fileName); > size = file.length(); > > project.setNewProperty(propName, size); > ]]> > </scriptdef> > > <getfs file="build.xml" property="buildfile.size"/> > <echo>size of buildfile is ${buildfile.size} Bytes</echo> > > </project> > > > -----Ursprüngliche Nachricht----- > > Von: Mark Lybarger [mailto:[EMAIL PROTECTED] > > Gesendet am: Dienstag, 2. November 2004 13:53 > > An: Ant Users List > > Betreff: RE: Ant Get FileSize using exec? > > > > RELEASE_FILE_SIZE=$(ls -l /path/to/file/filename|(read perms > > num_hd_links user group size rest; echo $size) ) > > > > here's the bash version that we use on solaris which sets the > > var on the left to the size of the file. > > > > > -----Original Message----- > > > From: Gareth Kelly [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday, November 02, 2004 7:43 AM > > > To: 'Ant Users List' > > > Subject: Ant Get FileSize using exec? > > > > > > > > > Hello, > > > I am trying to display the filesize, or set a property to be > > > equak to it. > > > I tried the exec tag, and can do this: > > > > > > <exec executable="ls"> > > > <arg line=" -al /export/home/kellyga/sparcs/war/SPARCS.war"/> > > > </exec> > > > > > > to get this: > > > > > > [exec] -rwxr--r-- 1 kellyga develop 4338595 Nov 1 10:51 > > > /export/home/kellyga/sparcs/war/SPARCS.war > > > > > > But all I need is the filesize. > > > Can anyone help? > > > > > > Gareth > > > > > > > > > > > > The information in this e-mail is confidential and may be > > > legally privileged. It is intended solely for the addressee. > > > Access to this e-mail by anyone else is unauthorised. If you > > > are not the intended recipient, any disclosure, copying, > > > distribution or any other action taken or any views, opinions > > > or advice contained in this e-mail are those of the sending > > > individual and not necessarily those of the firm. It is > > > possible for data transmitted by e-mail to be deliberately or > > > accidentally corrupted or intercepted. For this reason where > > > the communication is by e-mail, J&E Davy does not accept any > > > responsibility for any breach of confidence which may arise > > > from the use of this medium. If you have received this e-mail > > > in error please notify us immediately at > > > mailto:[EMAIL PROTECTED] and delete this e-mail from your system. > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > The information in this e-mail is confidential and may be > legally privileged. It is intended solely for the addressee. > Access to this e-mail by anyone else is unauthorised. If you > are not the intended recipient, any disclosure, copying, > distribution or any other action taken or any views, opinions > or advice contained in this e-mail are those of the sending > individual and not necessarily those of the firm. It is > possible for data transmitted by e-mail to be deliberately or > accidentally corrupted or intercepted. For this reason where > the communication is by e-mail, J&E Davy does not accept any > responsibility for any breach of confidence which may arise > from the use of this medium. If you have received this e-mail > in error please notify us immediately at > mailto:[EMAIL PROTECTED] and delete this e-mail from your system. > >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]