Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.
no avatar
User

sachin4921

Posts

15

Joined

Mon Nov 05, 2012 6:10 pm

426 Failure writing network stream

by sachin4921 » Thu Dec 13, 2012 7:14 pm

I had a directory over a machine with 25k number of files.
Using DirectoryListCallback interface implementation, i just wanted to list first 500 files only. I did so
but after completion of this listing, i got an error
com.enterprisedt.net.ftp.FTPException: 426 Failure writing network stream.
ERROR [STDERR] at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1235)
ERROR [STDERR] at com.enterprisedt.net.ftp.FTPClient.a(FTPClient.java:3760)
ERROR [STDERR] at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3604)



So what is this related to and how this problem can be resolved.
Connection mode is set to PASSIVE.
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: 426 Failure writing network stream

by support2 » Thu Dec 13, 2012 10:31 pm

Did you read all the files? That's an amazing number in one directory btw.
no avatar
User

sachin4921

Posts

15

Joined

Mon Nov 05, 2012 6:10 pm

In reply

by sachin4921 » Fri Dec 14, 2012 2:09 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: In reply

by support2 » Fri Dec 14, 2012 10:52 pm

When using this callback you still need to read the entire list.
no avatar
User

sachin4921

Posts

15

Joined

Mon Nov 05, 2012 6:10 pm

In reply

by sachin4921 » Mon Dec 17, 2012 3:55 pm

Hello Sir,
Thanks for your reply.
In reply to your answer "does that mean Even if i am using DirectoryListCallback, i have to list all those files present in the directory".
As per my understanding your API document contradicts your current statement.
Please elaborate if i am wrong.

And what i wanted is
"LISTING only 500 files following a particular pattern out of 25k files present in a directory".
so is this possible using any of your api without the need of reading all those file names present
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: In reply

by support2 » Mon Dec 17, 2012 4:04 pm

Could you post the bit of API documentation that you think says this.
no avatar
User

sachin4921

Posts

15

Joined

Mon Nov 05, 2012 6:10 pm

In reply

by sachin4921 » Mon Dec 17, 2012 4:55 pm

Hello Sir,
May be my understanding and actual statement is different still i am posting it as i though it could serve my purpose
Anyway here it is

dirDetails

public void dirDetails(java.lang.String dirname,
DirectoryListCallback lister)
throws java.io.IOException,
FTPException,
java.text.ParseException

Description copied from interface: FTPClientInterface
List a directory's contents via a callback. The callback is notified for each directory entry, meaning they can be processed individually. It also avoids out of memory problems if the directory is huge, and an array of thousands of FTPFile objects would otherwise be returned.

Specified by:
dirDetails in interface FTPClientInterface

Parameters:
dirname - name of directory (some servers permit a filemask)
lister - callback to be notified of errors
Throws:
java.io.IOException
FTPException
java.text.ParseException


no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: In reply

by support2 » Mon Dec 17, 2012 5:12 pm

What this means is that each directory entry is returned individually in the callback, instead of 25,000 at one time in an array (which could cause memory problems). You still have to download all the entries or you will get a server error as you've seen.

Who is online

Users browsing this forum: No registered users and 12 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron