Topic "Creating remote folder error with permissions"

Author Message
Perhogan
[View user's profile]
Donor
Joined: 2012-05-16
Posts: 10
Location: Germany
I need to create a remote folder on a sftp server and i use the workaround of creating it empty locally then "putFile" it to the server.

this works fine if i'm not specifying any permission, but it fails with the error -2146233079 operation is not valid due to the current status of the object. interesting enough it works with the normal files permissions.

here the code i use to assign permissions.

Code:

myFilePermissions.Text = "rwxrwxrwx"
myTransferOptions.FilePermissions = myFilePermissions
myTransferOptionsFolder.FilePermissions = myFilePermissions
   
myTransferOptionsFolder.TransferMode = TransferMode_Binary
myTransferOptions.TransferMode = TransferMode_Binary


Set transferResult = mySession.PutFiles(SourceFolder , RemoteFolder , False, myTransferOptionsFolder)
Set transferResult = mySession.PutFiles(SourceFolder & "/" & FileName , RemoteFolder , False, myTransferOptions)



if i comment the line number 3 everything works.

(i'm using VBA)
Perhogan
[View user's profile]
Donor
Joined: 2012-05-16
Posts: 10
Location: Germany
from a more detailed sebugging:

    1) remote file/folder does not exist
      a) I set permissions (no matter the value)
      Code:
      myTransferOptions.FilePermissions = myFilePermissions

        i. I transfer a file: everything works properly

        ii. I transfer a folder: remote folder and subfiles are created with the e right permissions but i get the error from assembly

      b) I don't set permissions: everything works as expected

    2) remote file/folder exist
      a) I set permissions (no matter the value)
        i. I transfer a file: everything works properly

        ii. I transfer a folder: remote folder is not updated (permissions are not updated with the new value but the files contained in it are properly set)

      b) I don't set permissions: everything works as expected and permissions are updated


The log does not show any errors i can detect in any of the conditions. as the operation is executed i found a workaround but correcting the bug might be helpful.

Any help is appreciated
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Thanks for your detailed report.

Perhogan wrote:
The log does not show any errors i can detect in any of the conditions. as the operation is executed i found a workaround but correcting the bug might be helpful.

What log do you mean? The session log (Session.SessionLogPath) or debug log (Session.DebugLogPath)? If you haven't tried the debug log file, please do and post it here (or email to me).
_________________
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