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

From: Jacob Nevins (jacobn_at_chiark.greenend.org.uk)
Date: 12/24/04

  • Next message: Neil W Rickert: "Re: openssh host-based authentication"
    Date: 24 Dec 2004 09:37:43 +0000 (GMT)
    
    

    manu <echarruau@yahoo.com> writes:
    >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).

    PSCP supports two methods of performing file operations: SCP (the older
    and simpler method) and SFTP (the newer method, which is used by default
    if possible). When in SCP mode, "pscp -ls" just performs an "ls" command
    on the server; scp_sftp_listdir() and SSH_FXP_OPENDIR is part of the
    procedure for fetching a list of files with SFTP.

    You can force a particular backend with the "-scp" and "-sftp" options;
    if you use "-scp" (and the server supports your "--time-style" option)
    you should find that your change becomes effective.

    >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.

    <http://www.ietf.org/internet-drafts/draft-ietf-secsh-filexfer-06.txt>
    (Note that this is a much newer version of the protocol spec than PuTTY
    supports, and cannot be used to fully understand the implementation in
    PSCP/PSFTP due to protocol changes.)

    >Does it exist a special SSH code to execute a ls -l
    >--time-style=long-iso to get the complete time description?

    No.

    ("pscp -ls" in SFTP mode uses the "longname" field returned by the SFTP
    server, and there's no way of requesting a particular format for that;
    there's no need, as if a particular field or format is required it is
    returned in a machine-readable form alongside the textual "longname"
    field, and can be output in whatever format is desired. We will probably
    have to do this at some point in any case, as more recent versions of
    the SFTP protocol have dropped the "longname" field.)


  • Next message: Neil W Rickert: "Re: openssh host-based authentication"

    Relevant Pages

    • Re: pscp ls --time-style=long-iso display
      ... I just read again the pscp documentation ... which I could extract all the date, time, and size info (that would be ... > (Note that this is a much newer version of the protocol spec than ... as if a particular field or format is required it is ...
      (comp.security.ssh)
    • Unable to SFTP
      ... we can't sftp using pscp ... (shareware secure copy tool) ... proprietary, or otherwise private information. ...
      (SunManagers)
    • Re: Putty PSCP hangs?
      ... There does seem to be a bug in PSCP here: ... SFTP initialisation message first. ... SFTP implementation is at liberty to call PSCP all sorts of nasty ...
      (comp.security.ssh)
    • Re: pscp (putty) doesnt use scp under SSH2
      ... >It seems that pscp only uses scp at the server side when using version ... >then pscp will make use of sftp-server. ... to force use of a particular protocol. ...
      (comp.security.ssh)