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

Guest

Re: Directorymask problem

martin wrote:

Time constraints do not work for folders.

But you can easily code the same in VB.NET:

Dim newFolders As IEnumerable(Of RemoteFileInfo) =
    session.ListDirectory(sourceRemotePath).Files.Where(
        Function(fileInfo) fileInfo.LastWriteTime >= Date.Now.AddDays(-3))
 
For Each newFolder In newFolders
    session.GetFiles(newFolder.FullName, targetLocalPath).Check()
Next


Jaroslav wrote:

Thanks your your answer.
I had to modify the code slightly so that the contents of the 3 downloaded directories were stored in separate directories and not overwritten in the root.
Below is a modified function code
Jaroslav

Dim newFolders As IEnumerable(Of RemoteFileInfo) =
    session.ListDirectory(sourceRemotePat).Files.Where(
    Function(fileInfo) fileInfo.LastWriteTime >= Date.Now.AddDays(-3))
For Each newFolder In newFolders
    If Not newFolder.FullName = "/." Then
        session.GetFiles(newFolder.FullName, targetLocalPath & "\" & newFolder.FullName.Replace("/", "")).Check()
    End If
Next
martin

Re: Directorymask problem

Time constraints do not work for folders.

But you can easily code the same in VB.NET:

Dim newFolders As IEnumerable(Of RemoteFileInfo) =
    session.ListDirectory(sourceRemotePath).Files.Where(
        Function(fileInfo) fileInfo.LastWriteTime >= Date.Now.AddDays(-3))
 
For Each newFolder In newFolders
    session.GetFiles(newFolder.FullName, targetLocalPath).Check()
Next
Guest

Re: Directorymask problem

martin wrote:

Jaroslav Vrbka wrote:

At source are placed only directories like
2017-11-26T0630+0000
2017-11-25T0630+0000
2017-11-24T0630+0000
2017-11-23T0630+0000

As these last modification timestamps or directory names?


Sorry for late answer.
The above are directory names.
The modification timestamps are similar.
26.11.2017 7:30:25
25.11.2017 7:30:36
...
martin

Re: Directorymask problem

Jaroslav Vrbka wrote:

At source are placed only directories like
2017-11-26T0630+0000
2017-11-25T0630+0000
2017-11-24T0630+0000
2017-11-23T0630+0000

As these last modification timestamps or directory names?
Jaroslav Vrbka

Directorymask problem

Dear all,

there is an option to download only directories older than, for example, 3 days?

At source are placed only directories like
2017-11-26T0630+0000
2017-11-25T0630+0000
2017-11-24T0630+0000
2017-11-23T0630+0000
...

I want to download only the 3 youngest.

If I use the options below, I will not download any directory.

Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Binary
transferOptions.PreserveTimestamp = False
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off
transferOptions.FileMask = "*/<3D"

If I use the options transferOptions.FileMask = "*/" I will download all directory.

Is there any possibility to reach my request using a filemask options?
If not how I can achieve it?

Thank you very much for your help
Jaroslav