winscp RemoteFileInfo retrun zero for file permission over FTP

Advertisement

subhankar80
Guest

winscp RemoteFileInfo retrun zero for file permission over FTP

Hello , i am using .net Assembly library . while opening a FTP connection and trying to use session.remotFileinfo , file permission it is returning as zero . but if i open the connection as SFTP, same function call returns correct file permission structure .

Reply with quote

Advertisement

subhankar80
Joined:
Posts:
1
Location:
India

even i am calling
fileInfo = mySession.GetFileInfo(DeleteDirectory & "/" & sourceFile(cnt).Text), Winscp is trying to read the file as directory . here is my arguments to winscp GetFileInfo /usr/people/user/AMT/AMT_NMDM_subtest.ssi. attached is the log


. 2015-07-07 20:46:37.556 --------------------------------------------------------------------------
. 2015-07-07 20:46:37.556 WinSCP Version 5.7.4 (Build 5553) (OS 6.1.7601 Service Pack 1 - Windows 7 Enterprise)
. 2015-07-07 20:46:37.556 Configuration: nul
. 2015-07-07 20:46:37.556 Log level: Normal
. 2015-07-07 20:46:37.556 Local account: PACRIM1\E329213
. 2015-07-07 20:46:37.556 Working directory: C:\D_DRIVE\787\MY_Work_Area\TotalControl\bin\Debug
. 2015-07-07 20:46:37.556 Process ID: 15924
. 2015-07-07 20:46:37.556 Command-line: "C:\D_DRIVE\787\MY_Work_Area\TotalControl\bin\Debug\winscp.exe" /xmllog="C:\Users\e329213\AppData\Local\Temp\wscp47C8.02A4F693.tmp" /xmlgroups /nointeractiveinput /dotnet=574 /ini=nul /log="C:\D_DRIVE\787\MY_Work_Area\TotalControl\bin\Debug\winscpLog.txt" /console /consoleinstance=_18376_7044526_745
. 2015-07-07 20:46:37.556 Time zone: Current: GMT+5:30 (India Standard Time), No DST
. 2015-07-07 20:46:37.556 Login time: Tuesday, July 07, 2015 8:46:37 PM
. 2015-07-07 20:46:37.556 --------------------------------------------------------------------------
. 2015-07-07 20:46:37.556 Script: Retrospectively logging previous script records:
> 2015-07-07 20:46:37.556 Script: option batch on
< 2015-07-07 20:46:37.556 Script: batch on
< 2015-07-07 20:46:37.556 Script: reconnecttime 120
> 2015-07-07 20:46:37.556 Script: option confirm off
< 2015-07-07 20:46:37.556 Script: confirm off
> 2015-07-07 20:46:37.556 Script: option reconnecttime 120
< 2015-07-07 20:46:37.556 Script: reconnecttime 120
> 2015-07-07 20:46:37.556 Script: open ftp://user:***@129.239.162.58 -passive=1 -timeout=10
. 2015-07-07 20:46:37.556 --------------------------------------------------------------------------
. 2015-07-07 20:46:37.556 Session name: user@129.239.162.58 (Ad-Hoc site)
. 2015-07-07 20:46:37.556 Host name: 129.239.162.58 (Port: 21)
. 2015-07-07 20:46:37.556 User name: user (Password: Yes, Key file: No)
. 2015-07-07 20:46:37.556 Transfer Protocol: FTP
. 2015-07-07 20:46:37.556 Ping type: C, Ping interval: 30 sec; Timeout: 10 sec
. 2015-07-07 20:46:37.556 Disable Nagle: No
. 2015-07-07 20:46:37.556 Proxy: none
. 2015-07-07 20:46:37.556 Send buffer: 262144
. 2015-07-07 20:46:37.556 UTF: 2
. 2015-07-07 20:46:37.556 FTP: FTPS: None; Passive: Yes [Force IP: A]; MLSD: A [List all: A]
. 2015-07-07 20:46:37.556 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2015-07-07 20:46:37.556 Cache directory changes: Yes, Permanent: Yes
. 2015-07-07 20:46:37.556 Timezone offset: 0h 0m
. 2015-07-07 20:46:37.556 --------------------------------------------------------------------------
. 2015-07-07 20:46:37.563 Connecting to 129.239.162.58 ...
. 2015-07-07 20:46:37.832 Connected with 129.239.162.58. Waiting for welcome message...
< 2015-07-07 20:46:38.074 220 (vsFTPd 2.0.5)
> 2015-07-07 20:46:38.074 USER user
< 2015-07-07 20:46:38.339 331 Please specify the password.
> 2015-07-07 20:46:38.339 PASS *******
< 2015-07-07 20:46:38.586 230 Login successful.
> 2015-07-07 20:46:38.586 SYST
< 2015-07-07 20:46:38.853 215 UNIX Type: L8
> 2015-07-07 20:46:38.853 FEAT
< 2015-07-07 20:46:39.093 211-Features:
< 2015-07-07 20:46:39.093 EPRT
< 2015-07-07 20:46:39.093 EPSV
< 2015-07-07 20:46:39.093 MDTM
< 2015-07-07 20:46:39.093 PASV
< 2015-07-07 20:46:39.490 REST STREAM
< 2015-07-07 20:46:39.490 SIZE
< 2015-07-07 20:46:39.490 TVFS
< 2015-07-07 20:46:39.490 UTF8
< 2015-07-07 20:46:39.490 211 End
> 2015-07-07 20:46:39.490 OPTS UTF8 ON
< 2015-07-07 20:46:39.740 200 Always in UTF8 mode.
. 2015-07-07 20:46:39.740 Connected
. 2015-07-07 20:46:39.740 --------------------------------------------------------------------------
. 2015-07-07 20:46:39.740 Using FTP protocol.
. 2015-07-07 20:46:39.740 Doing startup conversation with host.
> 2015-07-07 20:46:39.740 PWD
< 2015-07-07 20:46:40.001 257 "/usr/people/user"
. 2015-07-07 20:46:40.001 Getting current directory name.
. 2015-07-07 20:46:40.001 Startup conversation with host finished.
< 2015-07-07 20:46:40.001 Script: Active session: [1] user@129.239.162.58
> 2015-07-07 20:46:40.275 Script: pwd
< 2015-07-07 20:46:40.275 Script: /usr/people/user
> 2015-07-07 20:46:40.503 Script: stat -- "/usr/people/user/AMT/AMT_NMDM_subtest.ssi"
. 2015-07-07 20:46:40.503 Listing file "/usr/people/user/AMT/AMT_NMDM_subtest.ssi".
. 2015-07-07 20:46:40.503 Retrieving file information...
> 2015-07-07 20:46:40.503 PWD
< 2015-07-07 20:46:40.752 257 "/usr/people/user"
> 2015-07-07 20:46:40.752 CWD /usr/people/user/AMT/AMT_NMDM_subtest.ssi
< 2015-07-07 20:46:40.985 550 Failed to change directory.
> 2015-07-07 20:46:40.985 TYPE I
< 2015-07-07 20:46:41.252 200 Switching to Binary mode.
> 2015-07-07 20:46:41.252 SIZE /usr/people/user/AMT/AMT_NMDM_subtest.ssi
< 2015-07-07 20:46:41.521 213 8777
> 2015-07-07 20:46:41.521 MDTM /usr/people/user/AMT/AMT_NMDM_subtest.ssi
< 2015-07-07 20:46:41.760 213 20150417225757
. 2015-07-07 20:46:41.760 Retrieving file information successful
. 2015-07-07 20:46:41.760 AMT_NMDM_subtest.ssi;-;8777;2015-04-17T22:57:00.000Z;"" [0];"" [0];---------;0
< 2015-07-07 20:46:41.760 Script: ---------- 0 8777 Apr 18 4:27 AMT_NMDM_subtest.ssi
> 2015-07-07 20:46:44.122 Script: stat -- "/usr/people/user/AMT/AMT_NMDM_subtest.ssi"
. 2015-07-07 20:46:44.122 Listing file "/usr/people/user/AMT/AMT_NMDM_subtest.ssi".
. 2015-07-07 20:46:44.122 Retrieving file information...
> 2015-07-07 20:46:44.122 PWD
< 2015-07-07 20:46:44.377 257 "/usr/people/user"
> 2015-07-07 20:46:44.377 CWD /usr/people/user/AMT/AMT_NMDM_subtest.ssi
< 2015-07-07 20:46:44.621 550 Failed to change directory.
> 2015-07-07 20:46:44.621 TYPE I
< 2015-07-07 20:46:44.857 200 Switching to Binary mode.
> 2015-07-07 20:46:44.857 SIZE /usr/people/user/AMT/AMT_NMDM_subtest.ssi
< 2015-07-07 20:46:45.131 213 8777
> 2015-07-07 20:46:45.131 MDTM /usr/people/user/AMT/AMT_NMDM_subtest.ssi
< 2015-07-07 20:46:45.381 213 20150417225757
. 2015-07-07 20:46:45.381 Retrieving file information successful
. 2015-07-07 20:46:45.381 AMT_NMDM_subtest.ssi;-;8777;2015-04-17T22:57:00.000Z;"" [0];"" [0];---------;0
< 2015-07-07 20:46:45.381 Script: ---------- 0 8777 Apr 18 4:27 AMT_NMDM_subtest.ssi

Reply with quote E-mail

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: winscp RemoteFileInfo retrun zero for file permission over FTP

Your server does not support MLST command, so there's no way to retrieve permissions of a single file.

All you can do is to use Session.ListDirectory and find the file your need in the returned collection. It should include the permission.

Reply with quote

Advertisement

You can post new topics in this forum