0 votes
by (160 points)
edited

Hi,

I am using the rebex.net.sftp to connect. I am trying to use a log file to debug some issues.

Here is my code for the logwriter property.

Dim sftpClient As New Rebex.Net.Sftp() sftpClient.LogWriter = New Rebex.FileLogWriter("e:temp", Rebex.LogLevel.Debug) sftpClient.Connect(Domain, PortNumber) sftpClient.Login(Username, Password) sftpClient.GetFile(URL, LocalPath)

I am getting System.UnauthorizedAccessException to path "e:temp". I have verified that all the permissions are right. Infact my application writes different temp file to this directory using the same account. So, I am lost at this point. Any help is appreciated.

Thank you

Applies to: Rebex SFTP
by (132k points)
edited

Please try calling System.IO.File.WriteAllText("f:temp", "test"); - does it cause the same exception?

by (132k points)
edited

Also, what are you trying to achieve? Where would you like the log file to be placed? In a file inside the "temp" folder of the "e:" drive, or somewhere else?

1 Answer

0 votes
by (160 points)
edited

Yes, the .net class gave me the same exception. Apparently it is using the local system account for logging. After giving that account permissions to the folder, the logging is fine. Thank you very much for your response.

...