Re: how to get file permission....

Giganews Newsgroups
Subject: Re: how to get file permission....
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Fri, 28 Jan 2005

"DH, Sing" <comun…@empal.com> wrote in message
news:67A9318887BDE240comun…@empal.com...

> - IdFTP1.DirectoryListing.Items[i].OwnerName
> - IdFTP1.DirectoryListing.Items[i].GroupName
> - IdFTP1.DirectoryListing.Items[i].UserPermissions

Indy 10 uses a completely different directory listing architecture.  In Indy
9, there was only 1 class, TIdFTPListItem, that tried to do everything.
Indy 10, there are dozens of classes now, each one for a different data
format.  The values you are looking for are now part of the
TIdUnixBaseFTPListItem class, ie:

    Item := IdFTP1.DirectoryListing.Items[i];
    OwnerName := Item.OwnerName;

    if (Item is TIdUnixBaseFTPListItem) then
    begin
        GroupName := TIdUnixBaseFTPListItem(Item).GroupName;
        OwnerPermissions :=
TIdUnixBaseFTPListItem(Item).UnixOwnerPermissions;
        GroupPermissions :=
TIdUnixBaseFTPListItem(Item).UnixGroupPermissions;
        OtherPermissions :=
TIdUnixBaseFTPListItem(Item).UnixOtherPermissions;
    end else begin
        GroupName := '';
        OwnerPermissions := '';
        GroupPermissions := '';
        OtherPermissions := '';
    end;

When a Unix format is detected, a TIdUnixBaseFTPListItem instance will be
created for the item, such as TIdUnixFTPListItem.

Gambit

Replies

In response to

how to get file permission.... posted by DH, Sing on Fri, 28 Jan 2005