File Mask in remote path

Advertisement

jsp.net
Joined:
Posts:
4

File Mask in remote path

I am trying to use the GetFile method to retrieve specific files in a directory, but have been unsuccessful. Then tried the FileExists method and it comes back false. I know the files exists b/c when I manually connect and navigate to the directory and use the file mask, the files are there. I don't know if it's something with the file mask I am using. Again, I used this file mask on the directory manually and it shows the files I need. Any help would be much appreciated.

Example of remote path:

/remote/file/path/*_something<2013-05-10>2013-05-08

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: File Mask in remote path

Your mask it correct. Please post a complete session log file showing the problem (set Session.SessioLogPath).

Nb, Session.FileExist (singular) does not support file masks.
_________________
Martin Prikryl

Reply with quote

jsp.net
Joined:
Posts:
4

Thanks for the advice. I went ahead and Set the SessionLogPath and did so before calling the Open method, but it throws an exception saying cannot open Log: C:\Temp\directory. Would this indicate that the connection is at fault. I have it to where a user logs in and their username and password and other connection options are stored in a session. I then reuse this session when another event(button click) occurs. This is the point that I am at so far. Sorry, hope this makes sense, I am a little new to programming.

Reply with quote

jsp.net
Joined:
Posts:
4

Ok. I found what I was doing wrong. I needed to set the FileMask property in the TransferOption class and then pass the transfer option to the Session.GetFile method. After doing this it transferred the desired files, located by the file mask, to the appropriate local directory.

Reply with quote

tkennedy
Joined:
Posts:
11

Code Snippet?

jsp.net wrote:

Ok. I found what I was doing wrong. I needed to set the FileMask property in the TransferOption class and then pass the transfer option to the Session.GetFile method. After doing this it transferred the desired files, located by the file mask, to the appropriate local directory.

Would you be so kind as to post snippet of what you did? I've been trying to do this same thing for some time now.

Reply with quote

jsp.net
Joined:
Posts:
4

Session session = new Session();
TransferOptions transferOptions = new TransferOptions();

transferOptions.FileMask = "Your File Mask";

session.Open(Your Connection);
session.GetFiles(remotePath, localPath, false, transferOptions);

Reply with quote

Advertisement

You can post new topics in this forum