Link to home
Start Free TrialLog in
Avatar of mirghani
mirghani

asked on

indy vms list

hi all
does nay one use indy ftp client component to connect to vms operating system .
after doing idftp.list there is no any way to know if the list line is a file or directory , and also idFtp.size not working.
please help.
thanks
Avatar of din345
din345

idftp.list:

procedure TfrmMain.GetFileList;
var DirList: TIdFTPListItems;
    DirItem: TIdFTPListItem;
    i: Integer;
    buf: string;
begin
  if txtCurrentDir.Text <> '' then begin
    ListBox1.Clear;
    ListBox1.Items.Add('..');
    try
      buf := sckFTP.RetrieveCurrentDir;
    except end;
    if buf[1] <> '/' then buf := '/' + buf;
    if buf[Length(buf)] <> '/' then buf := buf + '/';
    txtCurrentDir.Text := buf;
    try
      sckFTP.ChangeDir(txtCurrentDir.Text);
    except end;
    try
      sckFTP.List(nil);
      DirList := sckFTP.DirectoryListing;
    except end;
    if Assigned(DirList) then begin
      for i := 0 to DirList.Count - 1 do begin
        DirItem := DirList.Items[i];
        if DirItem.ItemType = ditDirectory then begin
          if (DirItem.FileName <> '.') and (DirItem.FileName <> '..') then ListBox1.Items.Add('/' + DirItem.FileName)
        end;
      end;
      for i := 0 to DirList.Count - 1 do begin
        DirItem := DirList.Items[i];
        if DirItem.ItemType = ditFile then ListBox1.Items.Add(DirItem.FileName);
      end;
    end;
  end;
end;
Avatar of mirghani

ASKER

but this doesn't work with vms.
ASKER CERTIFIED SOLUTION
Avatar of bakry99
bakry99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial