Discuss (FTP), (FTP on .NET CF) and (FTPS, SFTP and SCP).

Running SFTP Command chmtime

no avatar
User

tahor

Posts

2

Joined

Wed Mar 06, 2013 3:51 am

Location

Costa Rica

Running SFTP Command chmtime

by tahor » Wed Mar 06, 2013 3:55 am

Hello Guys,

I having issues trying to invoke the command chmtime using a SecureFTPConnection object.

? If a use the InvokeFTPCommand method I got the error message: ?Method/property not valid for SFTP?

SecureFTPConnection ftpConnection;
.
.
.

string[] parameters = new string[2];
[0] = "<time_stamp>";
[1] = "<file_Path>";
reply = ftpConnection.InvokeFTPCommand("chmtime ", parameters);


? If a use the InvokeCommandSSH method I got the error message: 'chmtime' is not recognized as an internal or external command, operable program or batch file.

SecureFTPConnection ftpConnection;
.
.
.

string[] parameters = new string[2];
parameters[0] = "<time_stamp>";
parameters[1] = "<file_Path>";
string reply = ftpConnection.InvokeCommandSSH("chmtime ", parameters);

So my questions are: What method should I use invoke the command chmtime? And could you please provide me a code example?

Thanks in advance! :D
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Running SFTP Command chmtime

by support2 » Wed Mar 06, 2013 10:19 am

InvokeCommandSSH is the correct one to use. Is chmtime available on the server? Have you run it on the server using this user account?
no avatar
User

tahor

Posts

2

Joined

Wed Mar 06, 2013 3:51 am

Location

Costa Rica

by tahor » Thu Mar 07, 2013 12:55 am

Yes, chmtime is available on the server, in fact I can call that command using Filezilla client.

chmtime seems to not being recognized on the server when I use InvokeCommandSSH . The server is running Filezilla Server over Windows 2003.

string[] parameters = new string[2];
parameters[0] = "<time_stamp>";
parameters[1] = "<file_Path>";
string reply = ftpConnection.InvokeCommandSSH("chmtime ", parameters); <- 'chmtime' is not recognized as an internal or external command, operable program or batch file.

Am I calling the method in the correct way?
no avatar
User

EDT Support

Posts

905

Joined

Mon Apr 26, 2004 3:03 pm

by EDT Support » Thu Mar 07, 2013 9:46 am

The commands FileZilla displays in its console are not actual SFTP commands. In fact, the SFTP protocol doesn't really have commands as such at all, but instead uses parameterized messages with names like SSH_FXP_OPEN, SSH_FXP_READ and SSH_FXP_SETSTAT. The commands that are used in SFTP command-line clients and that you see in FileZilla are only meaningful within the client itself and are not actually sent over the line.

When FileZilla displays chmtime, I think it's simply telling you that it's set the mod-time of the remote file. To do this in SecureFTPConnection, you need to call the SetLastWriteTime method.

- Hans (EnterpriseDT)

Who is online

Users browsing this forum: No registered users and 18 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron