cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: sftp directory listing

From: James Housley <jim_at_thehousleys.net>
Date: Sat, 23 Aug 2008 07:20:38 -0400

On Aug 22, 2008, at 4:32 AM, Daniel Stenberg wrote:

> On Thu, 21 Aug 2008, Dan Fandrich wrote:
>
>>> SFTP actually provides the dir info in pure binary, so what you
>>> get is
>>
>> I thought that in some cases the formatted directory listing
>> output was sent by the remote server. That's the reason for the
>> postprocessing step (and the associated comment) in test613.pl
>
> I'm wrong, you are right.
>
> I think I was confusing it with something else. Yes, the directory
> listing seems to work pretty similar to FTP in the sense that the
> server sends the data already formatted on the server-side.

Dan and Daniel,

You are both right and are both wrong. SFTP servers return the
directory information in a standard attributes format with the file
name and a long text format that is chosen by the SFTP server. IIRC
the individual attributes were used first, but then I switched to
long text format. I know the long format provides the actual user
and group names where the attributes format just give them as numbers
with no way to change between. And showing user and group as numbers
makes it hard of then interfacing program it parse the line into it's
pieces. Also cURL would be duplicating the code that is on the
server side to convert the pieces into the individual parts.

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
                      http://www.FreeBSD.org     The Power to Serve
jim@TheHousleys.Net  http://www.TheHousleys.net
---------------------------------------------------------------------
The wise man built his network upon Un*x.
     The foolish man built his network upon Windows.
Received on 2008-08-23