Topic "Using .Net to rename file"

Author Message
mikedovell
[View user's profile]

Joined: 2012-04-29
Posts: 5
Location: USA
I am having an issue renaming the files that I transfer. The exact error that I receive is "Element "call" not found in the log file.

I am calling session.executecommand(mv fileuploaded newfilename);

Any help would be much apprecitated.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please set Session.DebugLogPath and post the log.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
I was not able to reproduce the problem. For me session.ExecuteCommand("mv ... ...") works.
_________________
Martin Prikryl
Vara04
[View user's profile]

Joined: 2012-05-26
Posts: 5
Location: France
Same pb:
I've got
'MV': command not understood.

I try with mv, MV, rename with the same result

Code:

2012-05-26 11:46:18Z] [0001] CallstackAndLock..ctor entering
[2012-05-26 11:46:18Z] [0001]   Command: [call MV /TestFTP/AACC.CSV /TestFTP/OUT/AACC.CSV]
[2012-05-26 11:46:18Z] [0001]   ExeSessionProcess.ExecuteCommand entering
[2012-05-26 11:46:18Z] [0003]       Scheduling output: [winscp> call MV /TestFTP/AACC.CSV /TestFTP/OUT/AACC.CSV]
[2012-05-26 11:46:18Z] [0003]     ExeSessionProcess.ProcessInputEvent leaving
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent leaving
[2012-05-26 11:46:18Z] [0001]   ExeSessionProcess.ExecuteCommand leaving
[2012-05-26 11:46:18Z] [0001]   Output: [winscp> call MV /TestFTP/AACC.CSV /TestFTP/OUT/AACC.CSV]
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent entering
[2012-05-26 11:46:18Z] [0003]     Scheduling output: [500 'MV': command not understood.]
[2012-05-26 11:46:18Z] [0001]   Output: [500 'MV': command not understood.]
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent leaving
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent entering
[2012-05-26 11:46:18Z] [0003]     Scheduling output: ['MV': command not understood.]
[2012-05-26 11:46:18Z] [0001]   Output: ['MV': command not understood.]
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent leaving
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent entering
[2012-05-26 11:46:18Z] [0003]     Scheduling output: []
[2012-05-26 11:46:18Z] [0001]   Output: []
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent leaving
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent entering
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent leaving
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent entering
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent leaving
[2012-05-26 11:46:18Z] [0003]   ExeSessionProcess.ProcessEvent entering
[2012-05-26 11:46:18Z] [0003]     ExeSessionProcess.ProcessInputEvent entering
[2012-05-26 11:46:18Z] [0001]   Exception: WinSCP.SessionRemoteException: 'MV': command not understood.
[2012-05-26 11:46:18Z] [0001]   Failed: [WinSCP.SessionRemoteException: 'MV': command not understood.]
[2012-05-26 11:46:18Z] [0001] CallstackAndLock..ctor leaving


Any idea ?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Vara04 wrote:
Same pb:
I've got
'MV': command not understood.

With FTP protocol this should do:
session.ExecuteCommand("RNFR ...")
session.ExecuteCommand("RNTO ...")

Though I cannot test it atm.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Support for renaming is tracked here:
https://winscp.net/tracker/show_bug.cgi?id=833
mikedovell
[View user's profile]

Joined: 2012-04-29
Posts: 5
Location: USA
prikryl wrote:
Please set Session.DebugLogPath and post the log.


I get an error that access to the path is denied and I am local admin on this machine. I have tried multiple paths with the same result.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
mikedovell wrote:
prikryl wrote:
Please set Session.DebugLogPath and post the log.


I get an error that access to the path is denied and I am local admin on this machine. I have tried multiple paths with the same result.

Can you be more specific please? Like posting the exception, including callstack. Also, how do you run the .NET code?
_________________
Martin Prikryl
mikedovell
[View user's profile]

Joined: 2012-04-29
Posts: 5
Location: USA
prikryl wrote:
mikedovell wrote:
prikryl wrote:
Please set Session.DebugLogPath and post the log.


I get an error that access to the path is denied and I am local admin on this machine. I have tried multiple paths with the same result.

Can you be more specific please? Like posting the exception, including callstack. Also, how do you run the .NET code?


session.SessionLogPath = "C:\logs" - Throws the exception "141"
session.SessionDebugPath = "C:\logs" - Throws the exception "Access to the path 'C:\logs' is denied."

It doesn't mater which directory that I point those two properties to, I always get those two exceptions. If I use the path ending with a backslash Eg - C:\Logs\ I get an exception that the property is not in the correct format.

Thanks,

Mike
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
mikedovell wrote:
session.SessionLogPath = "C:\logs" - Throws the exception "141"
session.SessionDebugPath = "C:\logs" - Throws the exception "Access to the path 'C:\logs' is denied."

It doesn't mater which directory that I point those two properties to, I always get those two exceptions. If I use the path ending with a backslash Eg - C:\Logs\ I get an exception that the property is not in the correct format.

It should be path to file (e.g. "c:\logs\session.log"), not path to directory.
_________________
Martin Prikryl
mikedovell
[View user's profile]

Joined: 2012-04-29
Posts: 5
Location: USA
Here is the debug log from the Call to rename the file. What's strange from the output is that when I just upload a file to the server it uses my public key and once I rename the public key section is empty. Perhaps this is why the server is refusing the command to rename?

[2012-06-04 09:55:07Z] [000a] Scheduling output: [winscp> call rename /incoming/sftptestfile3.tmp /incoming/sftptestfile3.txt]
[2012-06-04 09:55:07Z] [000a] ExeSessionProcess.ProcessInputEvent leaving
[2012-06-04 09:55:07Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:07Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:07Z] [000a] Scheduling output: [Searching for host...]
[2012-06-04 09:55:07Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:07Z] [0009] Output: [winscp> call rename /incoming/sftptestfile3.tmp /incoming/sftptestfile3.txt]
[2012-06-04 09:55:07Z] [0009] Output: [Searching for host...]
[2012-06-04 09:55:07Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:07Z] [000a] Scheduling output: [Connecting to host...]
[2012-06-04 09:55:07Z] [0009] Output: [Connecting to host...]
[2012-06-04 09:55:07Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:08Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:08Z] [000a] Scheduling output: [Authenticating...]
[2012-06-04 09:55:08Z] [0009] Output: [Authenticating...]
[2012-06-04 09:55:08Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:08Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:08Z] [000a] Scheduling output: [Using username "REMOVED".]
[2012-06-04 09:55:08Z] [0009] Output: [Using username "REMOVED".]
[2012-06-04 09:55:08Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:09Z] [000a] Scheduling output: [Authenticating with public key "".]
[2012-06-04 09:55:09Z] [0009] Output: [Authenticating with public key "".]
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:09Z] [000a] Scheduling output: [Server refused to start a shell/command]
[2012-06-04 09:55:09Z] [0009] Output: [Server refused to start a shell/command]
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:09Z] [000a] Scheduling output: [Authentication log (see session log for details):]
[2012-06-04 09:55:09Z] [000a] Scheduling output: [Using username "REMOVED".]
[2012-06-04 09:55:09Z] [0009] Output: [Authentication log (see session log for details):]
[2012-06-04 09:55:09Z] [000a] Scheduling output: [Authenticating with public key "".]
[2012-06-04 09:55:09Z] [0009] Output: [Using username "REMOVED".]
[2012-06-04 09:55:09Z] [000a] Scheduling output: [
]
[2012-06-04 09:55:09Z] [0009] Output: [Authenticating with public key "".]
[2012-06-04 09:55:09Z] [000a] Scheduling output: [Authentication failed.]
[2012-06-04 09:55:09Z] [0009] Output: [
]
[2012-06-04 09:55:09Z] [0009] Output: [Authentication failed.]
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent entering
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessInputEvent entering
[2012-06-04 09:55:09Z] [0009] Exception: WinSCP.SessionLocalException: Element "call" not found in the log file
[2012-06-04 09:55:09Z] [0009] CallstackAndLock..ctor leaving
[2012-06-04 09:55:09Z] [0009] CallstackAndLock..ctor entering
[2012-06-04 09:55:09Z] [0009] Session.DoDispose entering
[2012-06-04 09:55:09Z] [0009] Session.Cleanup entering
[2012-06-04 09:55:09Z] [0009] Command: [exit]
[2012-06-04 09:55:09Z] [0009] ExeSessionProcess.ExecuteCommand entering
[2012-06-04 09:55:09Z] [0009] ExeSessionProcess.ExecuteCommand leaving
[2012-06-04 09:55:09Z] [000a] Scheduling output: [winscp> exit]
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessInputEvent leaving
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvent leaving
[2012-06-04 09:55:09Z] [0009] ExeSessionProcess.Close entering
[2012-06-04 09:55:09Z] [0009] ExeSessionProcess.Close leaving
[2012-06-04 09:55:09Z] [0009] ExeSessionProcess.Dispose entering
[2012-06-04 09:55:09Z] [000a] ExeSessionProcess.ProcessEvents leaving
[2012-06-04 09:55:09Z] [0009] ExeSessionProcess.Dispose leaving
[2012-06-04 09:55:09Z] [0009] Session.Cleanup leaving
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Thanks. I was able to reproduce the problem. Will come back to you.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
This bug has been added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=871
mikedovell
[View user's profile]

Joined: 2012-04-29
Posts: 5
Location: USA
prikryl wrote:
This bug has been added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=871


When will a new release be available to address this issue?

Thanks,

Mike
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
There's no date set yet.

Anyway, please set Session.SessonLogPath and post or email me the log. I want to investigate why the key is empty when renaming the file.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License