Filemask date time problem

Advertisement

richtrot
Joined:
Posts:
1

Filemask date time problem

When I use the file mask with a date and time nothing transfers

my file mask is as follows
transferOptions.FileMask = "*.xml<=" + strTimeMask ;

when the above translates to *.xml<=2015-02-04 all files < or = are transferred.

when the above translates to *.xml<=2015-02-04 03:27:11 nothing is transferred.

I think it has something to do with the space between the time and date but do not know how to resolve this problem.

thanks for any help

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Filemask date time problem

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Bharath1988
Guest

File Masking

I am not able to use file masking in winscp 5.9.6, may i know the reason.
Which version of winscp will support file masking.

Reply with quote

martin
Site Admin
martin avatar

Re: File Masking

Bharath1988 wrote:

I am not able to use file masking in winscp 5.9.6
You have to tell us more. And show us your code.

Reply with quote

Tommy G
Guest

Re: Filemask date time problem

richtrot wrote:

When I use the file mask with a date and time nothing transfers

my file mask is as follows
transferOptions.FileMask = "*.xml<=" + strTimeMask ;

when the above translates to *.xml<=2015-02-04 all files < or = are transferred.

when the above translates to *.xml<=2015-02-04 03:27:11 nothing is transferred.

I think it has something to do with the space between the time and date but do not know how to resolve this problem.

thanks for any help

You are right, it is the space that is throwing things off. So you just just need to put the whole file mask in quotes, and it will work.

So assuming you're using C#...
 transferOptions.FileMask =  "\"*.xml<=" + strTimeMask + "\"";
Which translates to...
"*.xml<=2015-02-04 03:27:11" as your mask

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Filemask date time problem

Tommy G wrote:

You are right, it is the space that is throwing things off. So you just just need to put the whole file mask in quotes, and it will work.

So assuming you're using C#...
transferOptions.FileMask = "\"*.xml<=" + strTimeMask + "\"";
Which translates to...
"*.xml<=2015-02-04 03:27:11" as your mask
No, the quotes may not be there, they actually break the mask.

This is the correct code:
transferOptions.FileMask"*.xml<=" + strTimeMask;

If you have a different experience, please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum