Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Problems move files - Error permited denied

Session logs please, not XML logs.
Guest

Re: Problems move files - Error permited denied

Log XML WinSCP
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" name="******CTG7Y5@****150673.rm.cloudtotvs.com.br" start="2024-06-11T13:48:07.329Z">
<mv>
<filename value="/Arquivos_legado/Pendentes/AlteracaoSecao.xlsx" />
<destination value="/Arquivos_legado/Processados/AlteracaoSecao.xlsx" />
<result success="true" />
</mv>
<mv>
<filename value="/Arquivos_legado/Processados/AlteracaoSecao.xlsx" />
<destination value="/Arquivos_legado/Pendentes/AlteracaoSecao.xlsx" />
<result success="true" />
</mv>

Log xml .Net
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" name="******CTG7Y5@****150673.rm.cloudtotvs.com.br" start="2024-06-11T14:05:39.245Z">
<group name="open sftp://******CTG7Y5@****150673.rm.cloudtotvs.com.br:2323 -hostkey=&quot;*&quot; -timeout=15" start="2024-06-11T14:05:39.878Z">
</group>
<group name="pwd" start="2024-06-11T14:05:40.049Z">
<cwd>
<cwd value="/" />
<result success="true" />
</cwd>
</group>
<group name="stat -- &quot;/Arquivos_Legado/processados/AlteracaoSecao.xlsx&quot;" start="2024-06-11T14:05:41.827Z">
<stat>
<filename value="/Arquivos_Legado/processados/AlteracaoSecao.xlsx" />
<result success="false">
<message>Can't get attributes of file '/Arquivos_Legado/processados/AlteracaoSecao.xlsx'.</message>
<message>No such file or directory.
Error code: 2
Error message from server: No such file</message>
</result>
</stat>
<failure>
<message>Can't get attributes of file '/Arquivos_Legado/processados/AlteracaoSecao.xlsx'.</message>
<message>No such file or directory.
Error code: 2
Error message from server: No such file</message>
</failure>
</group>
<group name="mv &quot;/Arquivos_Legado/Pendentes/AlteracaoSecao.xlsx&quot; &quot;/Arquivos_Legado/Processados/AlteracaoSecao.xlsx&quot;" start="2024-06-11T14:06:45.687Z">
<failure>
<message>Error moving file '/Arquivos_Legado/Pendentes/AlteracaoSecao.xlsx' to '/Arquivos_Legado/Processados/AlteracaoSecao.xlsx'.</message>
<message>Permission denied.
Error code: 3
Error message from server: Permission denied</message>
</failure>
<mv>
<filename value="/Arquivos_Legado/Pendentes/AlteracaoSecao.xlsx" />
<destination value="/Arquivos_Legado/Processados/AlteracaoSecao.xlsx" />
<result success="false">
<message>Permission denied.
Error code: 3
Error message from server: Permission denied</message>
</result>
</mv>
</group>
martin

Re: Problems move files - Error permited denied

So please post logs both from GUI and the .NET.
carla.duarte

Re: Problems move files - Error permited denied

Realizando via WINSCP.exe funciona normalmente mover o arquivo com o usuário. Se chamo o método via código .net lança a exception.
martin

Re: Problems move files - Error permited denied

Does the teste1 folder exist? Do you have write permissions there? Can you move the file there in WinSCP GUI? Or in any other client? Post logs.
carla.duarte

Problems move files - Error permited denied

I am problems move files - error

Permission denied.
Error code: 3
Error message from server: Permission denied ao mover o arquivo /teste/Teste1.xlsx para /teste1/Teste1.xlsx.

at WinSCP.SessionLogReader.Read(LogReadFlags flags)
at WinSCP.ElementLogReader.Read(LogReadFlags flags)
at WinSCP.SessionElementLogReader.Read(LogReadFlags flags)
at WinSCP.ElementLogReader.Read(LogReadFlags flags)
at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.Session.MoveFile(String sourcePath, String targetPath)