Directory listing and ".bash_history" file?

Giganews Newsgroups
Subject: Directory listing and ".bash_history" file?
Posted by:  Prunesquallor (prunesquall…@proproco.co.uk)
Date: Thu, 30 Apr 2009

Dear All,

Using CPPB 2009, I've got a client using the TIdFTP component, and want to
distribute the directory listings into two ListBoxes: one for directories,
and one for files. I've added the IdAllFTPListParsers header (and am
explicitly linking the unit in), and everything seems to work with this code
(assuming we're already connected):

  UnicodeString Name;
  HostDirs1->Items->Clear();
  HostFiles1->Items->Clear();

  FTP1->List();
  for (i = 0; i < FTP1->DirectoryListing->Count; i++) {
    if (FTP1->DirectoryListing->Items[i]->ItemType == ditDirectory) {
      HostDirs1->Items->Add(FTP1->DirectoryListing->Items[i]->FileName);
    } else {
      HostFiles1->Items->Add(FTP1->DirectoryListing->Items[i]->FileName);
    }
  }

This works: directories are listed in HostDirs1, and files in HostFiles1.
Except for the files ".bash_history" and ".message": other files are shown,
but ones with the leading full stop are not displayed.

I can't see anything in the docs, and fooling around with the List command
(such as FTP1->List("",true)) doesn't seem to help either.

So how do I get TIdFTP/DirectoryListing to return those files (like my
commercial FTP client does?).

Thanks,

Prune.

Replies