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
mirghaniAsked:
Who is Participating?
 
bakry99Commented:
ok,,
there is a List parser in Indy 10
all you have to do is

idftp.ListParserClass:= TidFTPLPVMS;

and then do your list

idftp.list;

this will fill DirectoryListing and you have to use it like this


if idftp.DirectoryListing.Items[x].ItemType= ditDirectory then
  do something
else
if idftp.DirectoryListing.Items[x].ItemType= ditFile then
  do something

best regards
0
 
din345Commented:
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;
0
 
mirghaniAuthor Commented:
but this doesn't work with vms.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.