I'm using SharpSSH to write files to a unix machine. The files are supposed to be read and then deleted up by another application which resides on the unix machine.
The problem is that the unix application does not have rights to delete the file. I can see the file's permissions are rw-r-----
Here is my code:
public override void WriteFileg(string directoryName, string fileName, string responseText, host, username, password, port) {
// Write the file locally
TextWriter writer = new StreamWriter("TempForSftp.txt");
writer.WriteLine(responseText);
writer.Close();
// Transfer the local file
Sftp sftp = new Sftp(host, username, password);
sftp.Connect(int.Parse(port));
sftp.Put("TempForSftp.txt", directoryName + "/" + fileName);
sftp.Close();
}
How do I set different permissions?