Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

leokun

How to Use RemoteFileInfoCollection

Hi everyone,

I've just try to build an app to copy fils from an ovh ssh server and make it myself seem prety goot try to me.
(By using VB .Net -on MVS2012)

What I'm doing :
connect to the server, explore one folder with subfolders and looking for tar.gz files to topy thoses files.

There is my recursive code to copy files :
Sub CopyTarGz(ByVal dossier As String)

    Dim directory As RemoteDirectoryInfo = maSession.ListDirectory(dossier)
    Dim fileInfo As RemoteFileInfo
    Dim maCollec As New RemoteFileInfoCollection()
    For Each fileInfo In directory.Files
        If fileInfo.IsDirectory And Not fileInfo.Name.StartsWith(".") Then : CopyTarGz(dossier + fileInfo.Name)
        ElseIf fileInfo.Name.EndsWith("tar.gz") Then : maCollec.Add(fileInfo)
        End If
    Next
End Sub

the issue that I have is that my RemoteFileInfoCollection is readonly and I can't unlock it.

I'm a beginer at programming, but if I did understand well, I might be able to use this collection to store the RemoteFileInfo I want to copy later. Am I doing something wrong ?

Please let me know if you can help me, I only want to copy those tar.gz files and nothing else.

Thanks a lot !

Regards, Lo

ps : Sorry if my code is not that clean, I'm programming only since few months, also sorry about my english :)