Network I/O performance

J

Jo Demol

Hi,

I have a question about java network io. The problem is the following:
I have an ftp server with an acii file and I want to read the last
line from this file without transferring the complete file. Is this
possible? Because all my tests up till now seem to transfer the file
before processing it.

Your help is highly appreciated,

Jo
 
G

Gordon Beaton

I have a question about java network io. The problem is the
following: I have an ftp server with an acii file and I want to read
the last line from this file without transferring the complete file.
Is this possible? Because all my tests up till now seem to transfer
the file before processing it.

You've posted no information to show how you've attempted to retrieve
the last line, so it's impossible to say what you've done wrong. Also,
it's unclear from your post how this issue relates to Java
programming.

If your FTP server supports REST and you know how large the file is,
then you could start the transfer near the end. Or you could implement
a feature on the FTP server to help you retrieve the last line only,
then use the SITE command to execute it.

If you don't have to use FTP, you might find that there are easier
ways to get the last line, for example this shell command:

rsh serverhost tail -1 file

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top