Hi, I've a rather perplexing situation.
My
Java program has a loop which tests whether a file exists on Linux and if it does, then ftp the file back from Linux to WindowsXP(sp2).
The problem is, if the file does not exist on Linux, ft creates a zero length file on XP which is misleading to XP and must be deleted. However we cannot delete it because ftp seems to have locked the file.
Following is stub code for the loop:
And this is the code which ftps the GetOK
test file back from Linux:
Here is the method for executing the ftp, the ftp commands are in a text file
Here is the ftp commands in the text file
This generates the runtime error:
java.io.IOExceptiob: Bad file descriptor
.....at java.io.FileInputStream.available(Native Method)
.....at UseFTP.GetOK(UseFTP.java:552)
.....at UseFTP.Initialize(UseFTP.java:127)
.....at UseFTP.<init>(UseFTP:30)
.....at GetFiles.main(GetFiles.java:32)
The odd thing is when I crash out of the program UseFTP with a CTRL-C, the proper OKFile is ftp-ed back from Linux, overwriting the dud, zero length, OKFile created by ftp.
Any help greatly appreciated.