pscp ls --time-style=long-iso display

From: manu (echarruau_at_yahoo.com)
Date: 12/23/04


Date: 23 Dec 2004 10:56:15 -0800

Hi,

I am using pscp in a php program to retrieve some files.
Everything is working fine except that I can't retrieve the list of
file on server as --time-style=long-iso.
The consequence is that I can't always get the time of creation of a
file.
This gives the following output.

-rw-r--r-- 258048 Jul 9 14:15 TTFILE00-3165
-rw-r--r-- 62 Jul 9 14:16 TTFILE00-3165.crc
-rw-r--r-- 58048 Mar 1 2004 TTFILE00-4110
-rw-r--r-- 65 Mar 1 2004 TTFILE00-4110.crc

Under unix I would make
ls -l --time-style=long-iso
which would give me :

-rw-r--r-- 258048 2004-07-09 14:15 TTFILE00-3165
-rw-r--r-- 62 2004-07-09 14:16 TTFILE00-3165.crc
-rw-r--r-- 258048 2004-03-01 15:27 TTFILE00-4110
-rw-r--r-- 65 2004-03-01 15:35 TTFILE00-4110.crc

I am trying to modify the code of pscp to manage to send the
--time-style=long-iso information.
I first though it was a very single task as line 2085 (pscp.c)
is :
strcpy(cmd, "ls -la '");
I though I could simply add
strcpy(cmd, "ls -la --time-style=long-iso'");
to the program and the problem would be
unfortunatly this line has absolutly no effect on the program.

After some times, I found that the command to request a list of the
content of a directory is given in function void scp_sftp_listdir(char
*dirname) (line 636 pscp.c).

This function uses a second function fxp_opendir_send(char *path)
(line 585 pscp.c) which at its turn uses the function
sftp_pkt_init(SSH_FXP_OPENDIR) to send the code
#define SSH_FXP_OPENDIR 11 /* 0xb */.

Apparently pscp uses a ssh code (SSH_FXP_OPENDIR 11) to ask the server
to execute a ls.
I did not find any of these code in any ssh explanation.
Does it exist a special SSH code to execute a ls -l
--time-style=long-iso to get the complete time description?
Regards,

Emmanuel



Relevant Pages

  • Re: Putty: PSFTP connection without password prompt (CORRECT VERSION)
    ... you are sending files to a server ... Download puttygen, pageant and pscp from ... SSH Secure Shell downloaded from ... real Windows user, and have no idea of how to do it, try the ...
    (comp.security.ssh)
  • Re: Putty - pscp - "Connection Time out"
    ... When I try to use the pscp command to copy a file to the server I get ... Yes the ssh server does run on a non-standard port '6024' ...
    (comp.security.ssh)
  • Re: problems calling pscp from php
    ... It looks like Server and Client fail to generate a session encryption key. ... pscp from within php but not when using pscp from the command line? ... When transfering with pscp from command line ...
    (comp.security.ssh)
  • Re: problems calling pscp from php
    ... It looks like Server and Client fail to generate a session encryption key. ... pscp from within php but not when using pscp from the command line? ... When transfering with pscp from command line ...
    (comp.security.ssh)
  • sshd memory keeps increasing when client runs pscp
    ... I run pscp (part of putty package) version 0.53b from Windows XP to ... pscp throws error "Fatal: ... On the server, prstat shows that the number under ...
    (comp.security.ssh)