Problem with listing files (General questions)
Hi,
I'm having very strange problem with one SFTP server (on 3COM VCX PBX):
If I access a folder in third-party SFTP client I can see that folder changes.
The path I’m accessing is a symbolic link or a redirect of some kind, because when I type
type /opt/3Com/VCX/bssxml/data/city/outbox in third-party client it changes to “/opt/3Com/componants/bssxml.7.0.18/data/city/outbox/”. And I can see hundreds of XML files in that folder.
I can access same files using ActiveX version of FtpDLX, I’ve tried your sample file wodFtpDLX.html and it shows same files and I can download them.
However, I cannot list these files using COM-object version of FtpDLX. Every time I’m trying to do this it fails with 30031. I’ve added Done event and it shows Error: 30031. Server returned an error: No such file or folder .
I’ve tried both paths /opt/3Com/VCX/bssxml/data/city/outbox and “/opt/3Com/componants/bssxml.7.0.18/data/city/outbox/”. I’ve tried LoopFiles, ListDir, ListNames and all of them are failing.
I’ve also tried various values for ListParams (“”, *.xml , * , *.* , -a , -l , -al ).
Tried ListDir without parameters, specifying path in RemotePath. With no luck.
Same code works with other SFTP servers.
Could you help me figure out what the problem is, please?
This is the sample code I was using to test ListDir (and LoopFiles).
[code]
Option Explicit
On Error Resume Next
Dim objFTP, lst
Set objFTP = WScript.CreateObject( WeOnlyDo.wodFtpDLXCom.1 , wod_ )
objFTP.Protocol = 1
objFTP.Hostname = 10.16.10.11
objFTP.Port = 22
objFTP.Login = vcx
objFTP.Password = 123
objFTP.Blocking = 1
objFTP.Connect
WScript.Echo Initial path is: & objFTP.RemotePath
objFTP.RemotePath = /opt/3Com/VCX/bssxml/data/city/outbox
WScript.Echo Checking dir
objFTP.CheckDir
objFTP.ListParams =
WScript.Echo listing dir
objFTP.ListDir
Dim i
For Each i in objFTP.DirItems
WScript.Echo i.Name
next
‘ WScript.Echo looping files dir
‘ objFTP.LoopFiles /opt/3Com/VCX/bssxml/data/city/outbox/ , 1
objFTP.Disconnect
Sub wod_Connected(ErrorCode, ErrorText)
WScript.Echo Connected & ErrorText
End Sub
Sub wod_Disconnected()
WScript.Echo Disconnected
End Sub
Sub wod_LoopItem(LocalFile, RemoteFile, ItemType, Skip)
Dim strLine
strLine = Found
If ItemType = 0 Then
strLine = strLine & directory
End If
If ItemType = 1 Then
strLine = strLine & symbolic link
End If
If ItemType = 2 Then
strLine = strLine & file
End If
If ItemType = 3 Then
strLine = strLine & temp file/folder
End If
If ItemType = 4 Then
strLine = strLine & unknown item
End If
strLine = strLine & RemoteFile
WScript.Echo strLine
End Sub
Sub wod_Done(ErrorCode, ErrorText)
If ErrorCode <> 0 Then
WScript.Echo Error: & ErrorCode & . & ErrorText
End if
End Sub
[/code]
Sincerely,
Sergio
Complete thread:
- Problem with listing files - Sergio, 2006-08-30, 22:02
- Re: Problem with listing files - wodDrazen, 2006-08-30, 22:30