This project is read-only.

.NET SftpClient.ListDirectory() returns "." and ".."

Jun 10, 2014 at 3:44 PM
Hello all,

I couldn't open the Help-file and I didn't find any other threads about this. So just a little question.
Is it normal behaviour that the ListDirectory function returns "." and ".." as SftpFiles?

I find this pretty disturbing as they aren't real files and they can't be found in the directory...

Greetings,
Jun 16, 2014 at 11:56 PM
@PLanderwyn,

"I find this pretty disturbing as they aren't real files and they can't be found in the directory..."

Well, there are some that would take issue with that statement. In fact, as we learn in UNIX/Linux early on:

"On a UNIX system, everything is a file; if something is not a file, it is a process."

You can read more, as well as the quote above, here.

As to whether SshNet should treat these files as files or not is probably a discussion for the author/developer to take up with you, but on a Windows or Linux host, you will find that .. and . are in fact files.

I hope you find this less disturbing! :)

pat
:)