problem with file creation

hey...

While i am trying to copy a file from a folder to another folder, the new file is being created but with an info different from the original one...

eg:

the file hello.txt in a directory contains "gayatri"

and i am creating a new file hi.txt in another directory...

the file is created but the contents are being displayed as

udfhuahsd

sadfhidasdf

asdfuhasidfh

asdfhsiaisadf

asdfhioashdf

asdfhioasikss:w

\

can anyone help me on this issue...please

i will be waiting!

[566 byte] By [gayatri.shiga@gmail.coma] at [2007-11-27 4:04:40]
# 1

the code goes like this...

try {

jfw.connectAndLogin("10.238.118.7","cts122416","k122416");

System.out.println(jfw.getSystemName());

System.out.println(jfw.getRemotePort());

System.out.println(jfw.isConnected());

//System.out.println("HOLLA"+jfw.ascii());

jfw.changeWorkingDirectory("C:\\ftpsite\\load\\");

jfw.downloadFile("hello.txt","C:\\ftpsite\\download\\hi.txt");

jfw.binary();

jfw.disconnect();

actually, this code is written in some jakarta wrapper class where this method "downloadFile" is being called from another ftp.java.

gayatri.shiga@gmail.coma at 2007-7-12 9:09:34 > top of Java-index,Java Essentials,Java Programming...
# 2
paste full code refering to the new file creation and filling :)
calvino_inda at 2007-7-12 9:09:34 > top of Java-index,Java Essentials,Java Programming...
# 3

try {

jfw.connectAndLogin("10.238.118.7","cts122416","k122416");

System.out.println(jfw.getSystemName());

System.out.println(jfw.getRemotePort());

System.out.println(jfw.isConnected());

//System.out.println("HOLLA"+jfw.ascii());

jfw.changeWorkingDirectory("C:\\ftpsite\\load\\");

jfw.downloadFile("hello.txt","C:\\ftpsite\\download\\hi.txt");

jfw.binary();

jfw.disconnect();

//jfw.uploadFile("C:\\hello.txt","C:\\ftpsite\\load\\");

} catch (SocketException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

this is the ftp class...and the downloadFile method which is written in jakartawrapperclass...that code goes like this...

public boolean downloadFile (String serverFile, String localFile)

throws IOException, FTPConnectionClosedException {

FileOutputStream out = new FileOutputStream(localFile);

System.out.println("Local file path"+out.getChannel());

boolean result = retrieveFile(serverFile, out);

System.out.println("Result is "+result);

out.close();

return result;

}

gayatri.shiga@gmail.coma at 2007-7-12 9:09:34 > top of Java-index,Java Essentials,Java Programming...
# 4
does it change anything if you use / instead of \ in all your paths?(notice: not a good idea to paste ip/log/pass of ftps on a public forum!)
calvino_inda at 2007-7-12 9:09:34 > top of Java-index,Java Essentials,Java Programming...