login about faq

I’m using ChilkatSFTP ActiveX object for transferring file over sFTP. I have this requirement where we have to issue a command (chmod 640 <filename>) after uploading the file on to the destination server.

Does your ActiveX component support issuing such commands on the destination server?

asked Aug 30 '12 at 16:57

chilkat's gravatar image

chilkat ♦♦

Assuming you're asking about the Chilkat SSH/SFTP file transfer (meaning Secure File Transfer over SSH), then the answer is Yes. The SetPermissions method can be called after the upload to set the remote file permissions. Permissions on Linux/Unix boxes are written in octal format, so 640 is really an octal number. The same number in decimal format = 68^2 + 48 + 0 = 416. Therefore, you would pass the decimal integer 416 to the "permissions" argument to SetPermissions.


answered Aug 30 '12 at 17:01

chilkat's gravatar image

chilkat ♦♦

I'm going to answer my own question. The error is happening because my3rd parameter should be passed in Decimal rather than octal.

In my case, 644 converts to 420.

However one thing I didn't understand: How should we use the GetFilePermissions? This function returns an integer. I thought that it would be a decimal. However when I used it for a file, I received a value of 3188. What kind of value is that and how can I use it?


answered Sep 10 '15 at 22:19

Lambomania's gravatar image


Let's say I have an integer variable that holds a 32-bit value. One cannot say that the integer is "octal" or "decimal" or "hex". It is simply a 32-bit integer. It can be represented in character string form as octal, decimal, or hex, depending on how one groups the bits to form the chars. If I group bits 3 at a time and assign the symbols 0-7 for each 3-bit grouping, I'm showing the octal representation of the integer. If I group bits 4 at a time and assign the symbols 0-9A-F for each 4-bit grouping, then I'm showing the hex representation. The decimal representation wouldn't be an integral grouping of bits..

The answer is that you use bit operators to examine the bits of the 32-bit integer. Again, an integer cannot be said to be "decimal" or "octal", etc. It is only the string representation of the integer that can be said to be decimal, octal, etc.


answered Sep 11 '15 at 08:47

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Aug 30 '12 at 16:57

Seen: 3,787 times

Last updated: Sep 11 '15 at 08:47

powered by OSQA