PowerBuilder and GetAttributes not firing attribut - WeOnlyDo Discussion board

PowerBuilder and GetAttributes not firing attribut (wodSFTP / wodSFTP.NET / wodSFTPdll)

by fundementals, Monday, September 14, 2009, 20:35 (5550 days ago)

I'm using PowerBuilder 10.5 and WodFtpDLX V2.9.6. I am successfully using the dll in a production environment to Connect, disconnect, Makedir, putfile, getfile and Listdir.

When I try GetAttributes or GetSize, with parameters or without, the attribute event is not being fired, but the done event is being fired with errorcode of 0 (success).

I can't see why the attribute event is not being fired, unless I need a IwodFtpNotify object. (and I don't know how to get it) Does anyone have any ideas?

In fact, I'm only trying to confirm a particular file exists, is there an easier way of doing it?

Incidentally, I'm working with Blocking off.

Cheers

Charles

Re: PowerBuilder and GetAttributes not firing attr

by woddrazen, Monday, September 14, 2009, 21:10 (5550 days ago) @ fundementals

Hi Charles,


How big is file you want to check using GetAttributes Method? If you are retrieving information for files larger than 4.2GB you should use Attributes64 Event.

Did you check other Events maybe? For example Connected Event and StateChange Event. If Done Event works I don't see why other Events shouldn't.

Let us know how it goes.


Regards,
Drazen

Re: PowerBuilder and GetAttributes not firing attr

by fundementals, Wednesday, September 16, 2009, 19:26 (5548 days ago) @ woddrazen

I have a debugging system that outputs to a file every event that is fired, a copy of the file is shown here.

Log start at 18:04:02
upload Opened
Starting ue_next_done
0:Disconnected from server.
1:Connecting to server.
3:Sending authentication data.
Connected 0
4:Connected to server - idle.
14:Downloading directory list from the server.
13:Setting transfer mode.
7:Changing current directory.
14:Downloading directory list from the server.
5:Getting data channel.
listitems triggeredtype=dir;sizd=512;modify=20060827150328;UNIX.mode=0700;UNIX.uid=4294967295;UNIX.gid=4294967295;unique=0g0; _private

14:Downloading directory list from the server.
Beforeviewchange triggered
Actionviewchange triggered
done event 4 1 OK
Starting ue_next_done
End of Connect
4:Connected to server - idle.
14:Downloading directory list from the server.
13:Setting transfer mode.
7:Changing current directory.
14:Downloading directory list from the server.
5:Getting data channel.
listitems triggeredtype=cdir;sizd=512;modify=20090916170327;UNIX.mode=0700;UNIX.uid=4294967295;UNIX.gid=4294967295;unique=0g0; .

14:Downloading directory list from the server.
done event 4 2 OK
Starting ue_next_done
End of DirList
Start of GetSize
4:Connected to server - idle.
25:Checking file or folder attributes.
done event 4 3 OK
Starting ue_next_done
End of GetSize
4:Connected to server - idle.
disconnected triggered

I have edited out some of the files that came through when listitems was run.

The lines that start with a number and a colon are the statechange event.
Connected 0 is connected without errorcode and relates to event 'connected'
listitems triggered relates to event listitems
Beforeviewchange triggered relates to event Beforeviewchange
Actionviewchange triggered relates to event Actionviewchange
done event 4 1 OK means the done event was fired, the state was 4, it was finishing the 1st command and the errorcode was 0
disconnected triggered relates to event disconnected

The Start of GetSize has a state change to 25 Checking file or folder attributes, and then goes straight to the done event. Both the Attribute event and the attribute64 event should have produced lines in this log if they had run.

The other lines in the file relate to PowerBuilder, ue_next_done, is triggered from the done event and 'Start of' and 'End of' are indications of what happens next.

I hope this makes sense.

Cheers

Charles

Re: PowerBuilder and GetAttributes not firing attr

by woddrazen, Wednesday, September 16, 2009, 19:57 (5548 days ago) @ fundementals

Charles,


Can you please add this code to FtpReply Event and send us output:
[code]Debug.Print Command & & ReplyText[/code]
Drazen

Re: PowerBuilder and GetAttributes not firing attr

by fundementals, Thursday, September 17, 2009, 07:55 (5547 days ago) @ woddrazen

Log start at 06:53:27
upload Opened
Starting ue_next_done
0:Disconnected from server.
ftpreply triggered 220
1:Connecting to server.
ftpreply triggered USER activegraphic.co.uk 331
ftpreply triggered PASS zzzzz 230
ftpreply triggered FEAT 211
ftpreply triggered PWD 257
3:Sending authentication data.
Connected 0
4:Connected to server - idle.
14:Downloading directory list from the server.
ftpreply triggered TYPE A 200
13:Setting transfer mode.
ftpreply triggered CWD / 250
7:Changing current directory.
14:Downloading directory list from the server.
ftpreply triggered PASV 227
5:Getting data channel.
ftpreply triggered MLSD 150
listitems triggeredtype=dir;sizd=512;modify=20060827150328;UNIX.mode=0700;UNIX.uid=4294967295;UNIX.gid=4294967295;unique=0g0; _private

ftpreply triggered MLSD 226
14:Downloading directory list from the server.
Beforeviewchange triggered
Actionviewchange triggered
done event 4 1 OK
Starting ue_next_done
End of Connect
Start of ListDir
4:Connected to server - idle.
14:Downloading directory list from the server.
ftpreply triggered TYPE A 200
13:Setting transfer mode.
ftpreply triggered CWD /htdocs/transfer/ 250
7:Changing current directory.
14:Downloading directory list from the server.
ftpreply triggered PASV 227
5:Getting data channel.
ftpreply triggered MLSD 150
listitems triggeredtype=cdir;sizd=512;modify=20090916170327;UNIX.mode=0700;UNIX.uid=4294967295;UNIX.gid=4294967295;unique=0g0; .

ftpreply triggered MLSD 226
14:Downloading directory list from the server.
done event 4 2 OK
Starting ue_next_done
End of DirList
Start of GetSize
4:Connected to server - idle.
ftpreply triggered MLST /htdocs/transfer/ 250
25:Checking file or folder attributes.
done event 4 3 OK
Starting ue_next_done
End of GetSize
4:Connected to server - idle.
disconnected triggered
F:acornsA.TXT written

I have changed the password you see and shortened the results from listitems.

Re: PowerBuilder and GetAttributes not firing attr

by woddrazen, Thursday, September 17, 2009, 09:08 (5547 days ago) @ fundementals

Charles,


I'm sorry but I see in your log only commands that is send to server (Command variable output). We need also server reply. Output from FtpReply Event ReplyText variable.

Can you please remove all other logging and send us only Command and ReplyText variable output from Ftpreply Event.


Drazen

Re: PowerBuilder and GetAttributes not firing attr

by fundementals, Friday, September 18, 2009, 15:32 (5546 days ago) @ woddrazen

Log start at 14:11:40
ftpreply triggered 220 220-Matrix FTP server ready.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 Please note: files for your website must be stored under the htdocs directory.
ftpreply triggered USER activegraphic.co.uk 331 331 User activegraphic.co.uk OK. Password required
ftpreply triggered PASS zzzzzzzzzz 230 230 OK. Current directory is /
ftpreply triggered FEAT 211 211-Extensions supported:
EPRT
IDLE
MDTM
SIZE
REST STREAM
MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
MLSD
ESTP
PASV
EPSV
SPSV
ESTA
211 End.
ftpreply triggered PWD 257 257 / is your current location
ftpreply triggered TYPE A 200 200 TYPE is now ASCII
ftpreply triggered CWD / 250 250 OK. Current directory is /
ftpreply triggered PASV 227 227 Entering Passive Mode (213,171,193,5,230,60)
ftpreply triggered MLSD 150 150 Accepted data connection
ftpreply triggered MLSD 226 226-Options: -a -l
226 5 matches total
ftpreply triggered TYPE A 200 200 TYPE is now ASCII
ftpreply triggered CWD /htdocs/transfer/ 250 250 OK. Current directory is /htdocs/transfer
ftpreply triggered PASV 227 227 Entering Passive Mode (213,171,193,5,107,17)
ftpreply triggered MLSD 150 150 Accepted data connection
ftpreply triggered MLSD 226 226-Options: -a -l
226 22 matches total
ftpreply triggered MLST /htdocs/transfer/ 250 250-Begin
type=dir;sizd=512;modify=20090916170327;UNIX.mode=0700;UNIX.uid=4294967295;UNIX.gid=4294967295;unique=0g0; /htdocs/transfer/
250 End.
F:acornsA.TXT written

Cheers

Charles

Re: PowerBuilder and GetAttributes not firing attr

by fundementals, Friday, September 18, 2009, 16:08 (5546 days ago) @ fundementals

Hi

It looks like ftpreply.replytext contains the information I require. I don't know why attributes and attributes64 are not firing, but I will work on the basis of the replytext.

Thank you,

Cheers

Charles

Re: PowerBuilder and GetAttributes not firing attr

by woddrazen, Friday, September 18, 2009, 18:10 (5546 days ago) @ fundementals

Charles,


We tried debugging this, but couldn't figure this out. The Event is riggered, and all the code processed, but PB doesn't raise notification for it.

However, why don't you try using DirItems collection instead? DirItems collection is populated when ListDir is executed, and contains the same arguments, such as Size, permissions etc...

Here is example in VB
[code]...
dlx1.Blocking = True
dlx1.Connect

dlx1.ListDir /home/somefolder

Dim i As Integer

For i = 0 To dlx1.DirItems.Count - 1
If dlx1.DirItems(i).Name = filename.txt Then
Debug.Print dlx1.DirItems(i).Name & - Size: & dlx1.DirItems(i).Size
End If
Next i[/code]
Drazen