FTP "LIST" command help

  • Thread starter Thread starter Marco Castro
  • Start date Start date
M

Marco Castro

I tried to google for information of what the output of the "LIST" command
means but couldn't find any articles that tell me exactly what every
character means. I can figure out most of it, its only the first 12
characters where you see stuff like +rwx and so on that I am having trouble
with. Does anyone know of a website that explains in detail what all of the
values mean? Thanks.
 
Marco Castro said:
Thats exactly what I was looking for. Thanks guys.

Wrong. :)

The RFC will be of NO help here. FTP does NOT define the data returned by the
LIST command. Its totally free form.

That being said there are several common format and the one you referenced is
a Unix format.

rwx means that you have read, write, and execute permissions. They can be
listed twice - once for group permissions and once for user permissions. If
you see a d, its a directory. An l is a symbolic link.

Indy has full support for parsing just about every known FTP LIST format
known to man. You might consider it - its totally free.

http://www.indyproject.org/
 
I tried Indy but found its support to be lacking. Also didn't help that the
help files on its website are for an older version then is available. Do
you know of any websites that provide support for it? I especially couldn't
find any help on how to get the ftplistparser to work.
 
Marco Castro said:
I tried Indy but found its support to be lacking. Also didn't help that

Support? Did you try any of it support options? Indy has a lot better support
than the socket libs in .net. ;)

There is actually a whole team providing peer support (Free) and also even
commercial support available.
the help files on its website are for an older version then is

Yes. The help files currently are for Indy 9. They are planned to be updated.
available. Do you know of any websites that provide support for it? I

Yes. :)

http://www.indyproject.org/support.html

Its linked from every page. :)
 
[snip]
That being said there are several common format and the one you referenced is
a Unix format.

rwx means that you have read, write, and execute permissions. They can be
listed twice -

Wrong, there's three sets of permissions. The first set is the permissions
for the owner. The second set is permissions for the group that owns the
file. The third set is for everybody else.

e.g.

rwxr-xr-x

rwx - read, write, execute for owner
r-x - read and execute for the group
r-x - all others are permitted to read and execute

on a directory, the x means you can traverse into the directory (CD).

The Unix FTP directory list format comes from the fact that many Unix
servers would pipe output from the /bin/ls command. The /bin/ls command is
standardized by the OpenGroup and I think they have man pages on their
website (http://www.opengroup.org/).

HTH.
--
J. Peter Mugaas - Indy Pit Crew
Internet Direct (Indy) Website - http://www.nevrona.com/Indy
Personal Home Page - http://www.wvnet.edu/~oma00215
If I want to do business with you, I will contact you. Otherwise, do not
contact me.
 
I tried Indy but found its support to be lacking.

What specifically is the problem? Did you ever test Indy to see if it
would work?

If the FTPClient does not work, you may have a problem.
Also didn't help that the
help files on its website are for an older version then is available. Do
you know of any websites that provide support for it? I especially couldn't
find any help on how to get the ftplistparser to work.
The list parsing works automatically. You just get a directory listing.

If it doesn't work, you may want to send me a copy of the list output
exactly as you got it. Maybe I can fix the code or write another parser
specifically for it.
--
J. Peter Mugaas - Indy Pit Crew
Internet Direct (Indy) Website - http://www.nevrona.com/Indy
Personal Home Page - http://www.wvnet.edu/~oma00215
If I want to do business with you, I will contact you. Otherwise, do not
contact me.
 
I must have missed the peer support option on the website. I'll give it
another try once I get home since the site doesn't seem to be working for me
right now. Thanks for the help.
 
I tested indy and did get it to connect to the ftp without any problems. I
even go it to return to me the directory listing, I just couldn't figure out
how to use the parsers that come with it to make the listing more helpfull.
Could you give me an example of how this is suposed to work? Btw, I don't
want you to think that I'm knocking your product. I think that its great.
Only problem for me right now is that there doesn't seem to be much of in
the way of help files or examples for .net users. Im sure that's a problem
that will sort itself out once more people start to adopt it.
Here is the code that I am using.

If mFTP.Connected = False Then

'Set connection values
mFTP.Host = txtAddress.Text
mFTP.Username = txtUser.Text
mFTP.Password = txtPassword.Text
mFTP.Port = nupPort.Value
mFTP.Passive = True

'Connect
mFTP.Connect(False)

'Login if connected ok
If mFTP.Connected = True Then
btnConnect.Text = "Disconnect"

mFTP.Login()

mFTP.List(mFTP.ListResult, "", True)

txtOutput.Text = mFTP.ListResult.Text
End If

Else
mFTP.Disconnect()
btnConnect.Text = "Connect"
End If
 
I tested indy and did get it to connect to the ftp without any problems. I
even go it to return to me the directory listing, I just couldn't figure out
how to use the parsers that come with it to make the listing more helpfull.
Could you give me an example of how this is suposed to work?

The way it is supposed to work is transparently with a self-registering
mechanism where class references are added to a global object and the FTP
client uses that object. You use the DirectoryListing property. That's a
collection of objects. You then access properties in the objects such as
LocalFileName, Size, and ModifiedDate. That's at a basic level. Most of
the time, you will get a directory listing in the Unix or Windows NT
directory formats (that's about 99% of them).



At a more advance level, you can see what data the parser will return with
the ListParserCapabilities property. That's a set which could include the
following:

Capability Property Name
flcUnixOwnerPermissions - UnixOwnerPermissions
flcUnixGroupPermissions - UnixGroupPermissions
flcUnixOtherPermissions - UnixOtherPermissions

There's some other capabilities that may appear in that set and those
correspond in names with the property values. The rest of the capabilities
are:

flcItemCount,
flcOwnerName,
flcGroupName,
flcSize,
flcModifiedDate,
flcModifiedDateGMT,
flcCreatedDate,
flcCreatedDateGMT,
flcUniqueID,
flcLinkedItemName,
flcUnixinode,
flcUnitreeFileFamily,
flcRecLength,
flcRecFormat,
flcNumberRecs,
flcNumberBlocks,
flcBlockSize,
flcVMSSystemPermissions,
flcVMSOwnerPermissions,
flcVMSGroupPermissions,
flcVMSWorldPermissions,
flcNovellPermissions,
flcMigrated,
flcMVSDSOrg,
flcMVSVolume,
flcMVSUnit,
flcMVSNumberTracks,
flcMVSNumberExtents,
flcMVSJobStatus,
flcMVSJobSpoolFiles,
flcMVSJESInf2Details,
flcVSEPQDisposition,
flcVSEPQPriority,
flcRTOSMemStart,
flcRTOSMemEnd,
flcOS9OwnerPermissions,
flcOS9PublicPermissions,
flcOS9MiscPermissions,
flcOS9Sector,
flcHP3000Limit,
flcDist32FileAttributes,
flcMLISTPermissions

A lot of these are platform specific items that you may not really need
unless you are dealing with those particular servers. I added them in an
attempt to NOT dumb down to a lowest common denominator. Different
platforms have different capabilities and the file systems will be totally
different. A few IBM mainframes can use FTP as an interface to a job queue.
You can get the name of the parser identifier string with the DirFormat
property.

I admit that this sounds complex but don't let that intimidate you. The
idea is that a developer may selectively present columns to a user
depending upon the directory list format.

If the DirectoryListing property doesn't work, than please let us know.

I can't really tell you how to use this stuff in Visual Studio as I don't
know C# or VB# and I don't have Visual Studio at all and I wouldn't know
how to use it even if I did have it. I program primarily in Borland
Delphi.

HTH.
--
J. Peter Mugaas - Indy Pit Crew
Internet Direct (Indy) Website - http://www.nevrona.com/Indy
Personal Home Page - http://www.wvnet.edu/~oma00215
If I want to do business with you, I will contact you. Otherwise, do not
contact me.
 
But how do you populate the DirectoryListing property? I see nothing in
there that would tell the ftp to retrieve a directory list. The only
function that I see that can get a directory listing in the entire ftp class
is .list().
And that function will send the directory listing to a variable of TStrings
type. Is there some way to use that to populate the .DirectoryListing
property?
 
It's not for me. I might have an outdated version of the control so I'll
check if there is a newer version available. And thanks for spending all
this time answering my questions.
 
Marco Castro said:
It's not for me. I might have an outdated version of the control so I'll
check if there is a newer version available. And thanks for spending all
this time answering my questions.

The new version definitely does, and there is an FTP demo available now too.
 
Back
Top