-
-
Notifications
You must be signed in to change notification settings - Fork 4
SSH.SFTPDirectory
SSH.SFTPDirectory
Protected Class SFTPDirectory
This class represents a directory listing operation over SFTP.
Create a new instance and then read the CurrentName
, CurrentType
, CurrentLength
, etc. properties to get metadata on the current item in the listing, then call ReadNextEntry()
to load the next item.
If the SuppressVirtualEntries
property is set to True
and the directory is empty then the CurrentType
property will be SFTPEntryType.Unknown
and the CurrentIndex
property will be -1
. If SuppressVirtualEntries
is False
then an empty directory will appear to contain two subdirectories.
- AccessTime As Date
- CurrentAccessTime As Date
- CurrentIndex As Integer
- CurrentLength As UInt64
- CurrentMode As Permissions
- CurrentModifyTime As Date
- CurrentName As String
- CurrentType As SFTPDirectory.EntryType
- FullPath As String
- LastError As Int32
- Mode As Permissions
- ModifyTime As Date
- Name As String
- Parent As SFTPDirectory
- Session As SFTPSession
- SuppressVirtualEntries As Boolean
This example collects the names of all files and subdirectories in a remote directory:
Dim session As SSH.Session = SSH.Connect("ssh://user:[email protected]/")
Dim sftp As New SSH.SFTPSession(session)
Dim names() As String
Dim lister As SSH.SFTPDirectory = sftp.ListDirectory("/path/to/dir/")
Do
names.Append(lister.CurrentName)
Loop Until Not lister.ReadNextEntry()
lister.Close()
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2018-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.