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=11044>.
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=11044
FTP chmod from Windows-UNIX: wrong separator
Summary: FTP chmod from Windows-UNIX: wrong separator
Product: Ant
Version: 1.5
Platform: Other
OS/Version: Other
Status: NEW
Severity: Major
Priority: Other
Component: Optional Tasks
AssignedTo: ant-dev@jakarta.apache.org
ReportedBy: cmcfarland@onebox.com
FTP chmod from Windows to UNIX-style environment does not work. Verbose output
shows ant attempting to chmod remote files using Windows style separator ("\")
instead of the UNIX-style ("/") separator. I noticed a potential problem in the
optional task FTP.java file, which I will cover at the bottom of this message.
Here is stripped down ant script which I use to duplicate the problem. Note
that you must be executing from Windows to the target environment requiring "/"
separators.
EXAMPLE SCRIPT:
<target name="chmod">
<ftp action="chmod"
server="${remote.server}"
remotedir="${target.dir}"
userid="${remote.username}"
password="${remote.password}"
separator="/"
chmod="775"
>
<fileset>
<include name="**/*"/>
</fileset>
</ftp>
</target>
Looking in FTP.java source, I noticed recursive FTP.FTPDirectoryScanner.scandir
() method implements hard-coded "File.separator" as the path separator, where I
would have expected the FTP attribute "remoteFileSep" to be used instead.
Obviously, since I am executing the script on Windows, the File.separator will
be Windows style, but we are doing our directory scan targeted for the remote
platform. As an interim solution I replaced the "File.separator" occurances
w/ "remoteFileSep" and it works.
A possibly separate, but related bug: the following ftp "put/send" script does
not work for same reason; that is, verbose output shows windows separators for
chmod on remote machine. The interim fix above did not fix this.
EXAMPLE SCRIPT:
<target>
<ftp server="${remote.server}"
remotedir="${target.dir}"
userid="${remote.username}"
password="${remote.password}"
binary="no"
action="put"
chmod="775"
verbose="yes"
depends="no"
ignoreNoncriticalErrors="true"
>
<fileset dir="${deploy.dir}">
<!-- xfer these files in ascii -->
<include name="**/application.webapp"/>
<include name="**/version.txt"/>
<include name="**/gass.properties"/>
<include name="**/user.profiles"/>
</fileset>
</ftp>
</target>
--
To unsubscribe, e-mail: <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
|