Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7.8k views
in .NET FTP by
I have a program that iterated through files in a folder on an FTP server.

3 weeks ago it suddenly stopped finding files. There were no updates to the program. It worked for 4 months and one day it just stopped doing it. DirDetails always returned 0 files.

I replaced the code with the Dir() method and everything worked again. I included code below. (warning evil VB.. ;-) )

What could have caused this?

It is possible that there was something changed on the FTP server itself. How ever I don't have control over it.

Thanks
Wouter


<code>
Dim ftp As New FTPClient(FTPHost)
ftp.ParsingCulture = New CultureInfo(FTPLocale)
ftp.User(FTPUser)
ftp.Password(FTPPass)

ftp.ConnectMode = FTPConnectMode.PASV
ftp.TransferType = FTPTransferType.BINARY


For Each file As String In ftp.Dir(TARFolder)
' This code works
Next

For Each file As FTPFile In ftp.DirDetails(TARFolder)
' this loop is never done since DirDetails fails to find files.
Next
</code>

9 Answers

0 votes
by
I have the same problem
0 votes
by (162k points)
Strange. Can you please post your log file?
0 votes
by
I have the same problem and i got this exception java.text.ParseException: Unparseable date: "drwxr-xr-x 1"
0 votes
by (162k points)
Please, post the stack trace and log file. We can't help unless people do this.

I have the same problem and i got this exception java.text.ParseException: Unparseable date: "drwxr-xr-x 1"
0 votes
by
i have the same problem !

but i have no Exception ! :(
server is TYPSoft FTP Server
0 files found with dirDetails(client.pwd());
but 0 with dir(client.pwd()); too !!

dir(); works perfectly but i can't make difference between files and directories !


220 TYPSoft FTP Server 1.10 ready...
---> USER Anonymous
331 Password required for Anonymous.
---> PASS ********
230 User Anonymous logged in.
---> PWD
257 "/" is current directory.
---> PASV
227 Entering Passive Mode (127,0,0,1,7,54).
---> LIST /
150 Opening data connection for directory list.
226 Transfer complete.

and -> client.dirDetails("/").length = 0
0 votes
by (162k points)
Are you sure there are visible files present in "/"?

What does typing "dir" in a command line FTP client give you?

i have the same problem !

but i have no Exception ! :(
server is TYPSoft FTP Server
0 files found with dirDetails(client.pwd());
but 0 with dir(client.pwd()); too !!

dir(); works perfectly but i can't make difference between files and directories !


220 TYPSoft FTP Server 1.10 ready...
---> USER Anonymous
331 Password required for Anonymous.
---> PASS ********
230 User Anonymous logged in.
---> PWD
257 "/" is current directory.
---> PASV
227 Entering Passive Mode (127,0,0,1,7,54).
---> LIST /
150 Opening data connection for directory list.
226 Transfer complete.

and -> client.dirDetails("/").length = 0
0 votes
by
sure ! 43 files and folders !

dir in / :

drw-rw-rw- 1 ftp ftp 0 May 22 00:27 .
drw-rw-rw- 1 ftp ftp 0 May 22 00:27 ..
dr--r--r-- 1 ftp ftp 0 May 22 00:33 Mes images
........

but other problem is that dir("/"); returns 0 files
only dir(); works !
0 votes
by
i think i found the problem !
the FileParser :
we have to detect the good Parser to use

for example, connect to ftp.antesis.org, use :
FTPFileParser parser = new UnixFileParser();
FTPFileFactory fileFactory = new FTPFileFactory(parser);
client.setFTPFileFactory(fileFactory);
client.setParserLocale(Locale.US);
--> dirDetails("/"); works !!!

but with client.system(); this server returns
215 UNIX Type: L8
and my local server on windows xp returns
215 UNIX Type: L8

and this FileParser configuration doesn't work
i think we can't use system(); to find the good parser to use

then how can i find the good FileParser which is different for differents servers ??
0 votes
by (162k points)
See this thread for why 0 files are returned

http://www.enterprisedt.com/forums/view ... =2206#2206

sure ! 43 files and folders !

dir in / :

drw-rw-rw- 1 ftp ftp 0 May 22 00:27 .
drw-rw-rw- 1 ftp ftp 0 May 22 00:27 ..
dr--r--r-- 1 ftp ftp 0 May 22 00:33 Mes images
........

but other problem is that dir("/"); returns 0 files
only dir(); works !

Categories

...