login about faq

There appears to be a behavior change in SFTP directory/file handling between DLL versions 9.1.2.0 and 9.3.1.0 as observed in your example program:


Chilkat.SFtpDir dirListing = null;
dirListing = sftp.ReadDir(handle);

int i;
int n = dirListing.NumFilesAndDirs;

for (i = 0; i <= n - 1; i++)
{
   Chilkat.SFtpFile fileObj = null;
   fileObj = dirListing.GetFileObject(i);

Console.WriteLine(fileObj.Filename);
   Console.WriteLine(fileObj.FileType);
   Console.WriteLine("Size in bytes: " + fileObj.Size32);
   Console.WriteLine("----");
}

The "." and ".." directories are included in the v9.1.2 output, but not in the 9.3.1.0 version output.

asked Jun 13 '12 at 19:29

chilkat's gravatar image

chilkat ♦♦
11.8k316358420


Yes, omitting the "." and ".." was an intentional change because developers did not want them included.

Here's a new build that includes a new SFTP property named IncludeDotDirs. The default value is false. If set to true, then the "." and ".." directories will be included in the results.

http://www.chilkatsoft.com/preRelease/ChilkatDotNet2.zip

This new property will become available in the next official release.

link

answered Jun 13 '12 at 19:31

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×200
×7

Asked: Jun 13 '12 at 19:29

Seen: 1,528 times

Last updated: Jun 13 '12 at 19:31

powered by OSQA