Back to product page
- Introduction
- License agreement
- Classes
- Enumerations
- Exceptions
- WeOnlyDo.Client.SFTP
- Methods
- Properties
- Authentication
- Blocking
- BufferSize
- Compression
- Encryption
- EncryptionList
- HMacList
- Hostname
- KeepAlives
- KeyExchangeList
- LastError
- ListItem
- LocalPath
- Login
- MaxTransferRate
- Password
- Port
- PrivateKey
- ProxyHostname
- ProxyLogin
- ProxyPassword
- ProxyPort
- ProxyType
- RemoteIdentification
- RemotePath
- Resume
- State
- Timeout
- TransferMode
- TransferRate
- TransferTime
- Version
- Events
- How to get support?
SetAttributes method
Type
VoidSyntax
- C#
- VB.NET
public Void SetAttributes(Int64 Permissions);
The SetAttributes(Permissions) syntax has these parts:
public Void SetAttributes(UInt64 Size);
The SetAttributes(Size) syntax has these parts:
public Void SetAttributes(Int64 Uid, Int64 Gid);
The SetAttributes(Uid,Gid) syntax has these parts:
public Void SetAttributes(DateTime AccessTime, DateTime ModificationTime);
The SetAttributes(AccessTime,ModificationTime) syntax has these parts:
public Void SetAttributes(String RemotePath, Int64 Permissions);
The SetAttributes(RemotePath,Permissions) syntax has these parts:
public Void SetAttributes(String RemotePath, UInt64 Size);
The SetAttributes(RemotePath,Size) syntax has these parts:
public Void SetAttributes(String RemotePath, Int64 Uid, Int64 Gid);
The SetAttributes(RemotePath,Uid,Gid) syntax has these parts:
public Void SetAttributes(String RemotePath, DateTime AccessTime, DateTime ModificationTime);
The SetAttributes(RemotePath,AccessTime,ModificationTime) syntax has these parts:
public Void SetAttributes(UInt64 Size, Int64 Uid, Int64 Gid, Int64 Permissions, DateTime AccessTime, DateTime ModificationTime);
The SetAttributes(Size,Uid,Gid,Permissions,AccessTime,ModificationTime) syntax has these parts:
public Void SetAttributes(String RemotePath, UInt64 Size, Int64 Uid, Int64 Gid, Int64 Permissions, DateTime AccessTime, DateTime ModificationTime);
The SetAttributes(RemotePath,Size,Uid,Gid,Permissions,AccessTime,ModificationTime) syntax has these parts:
The SetAttributes(Permissions) syntax has these parts:
Permissions | Sets file or directory permissions. |
public Void SetAttributes(UInt64 Size);
The SetAttributes(Size) syntax has these parts:
Size | New file size. You can truncate file to 0, or set it to any size of your choice. |
public Void SetAttributes(Int64 Uid, Int64 Gid);
The SetAttributes(Uid,Gid) syntax has these parts:
Uid | Sets user owner for the file or directory. |
Gid | Sets group owner for the file or directory. |
public Void SetAttributes(DateTime AccessTime, DateTime ModificationTime);
The SetAttributes(AccessTime,ModificationTime) syntax has these parts:
AccessTime | Sets last access time. |
ModificationTime | Sets last modification time. |
public Void SetAttributes(String RemotePath, Int64 Permissions);
The SetAttributes(RemotePath,Permissions) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
Permissions | Sets file or directory permissions. |
public Void SetAttributes(String RemotePath, UInt64 Size);
The SetAttributes(RemotePath,Size) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
Size | New file size. You can truncate file to 0, or set it to any size of your choice. |
public Void SetAttributes(String RemotePath, Int64 Uid, Int64 Gid);
The SetAttributes(RemotePath,Uid,Gid) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
Uid | Sets user owner for the file or directory. |
Gid | Sets group owner for the file or directory. |
public Void SetAttributes(String RemotePath, DateTime AccessTime, DateTime ModificationTime);
The SetAttributes(RemotePath,AccessTime,ModificationTime) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
AccessTime | Sets last access time. |
ModificationTime | Sets last modification time. |
public Void SetAttributes(UInt64 Size, Int64 Uid, Int64 Gid, Int64 Permissions, DateTime AccessTime, DateTime ModificationTime);
The SetAttributes(Size,Uid,Gid,Permissions,AccessTime,ModificationTime) syntax has these parts:
Size | New file size. You can truncate file to 0, or set it to any size of your choice. |
Uid | Sets user owner for the file or directory. |
Gid | Sets group owner for the file or directory. |
Permissions | Sets file or directory permissions. |
AccessTime | Sets last access time. |
ModificationTime | Sets last modification time. |
public Void SetAttributes(String RemotePath, UInt64 Size, Int64 Uid, Int64 Gid, Int64 Permissions, DateTime AccessTime, DateTime ModificationTime);
The SetAttributes(RemotePath,Size,Uid,Gid,Permissions,AccessTime,ModificationTime) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
Size | New file size. You can truncate file to 0, or set it to any size of your choice. |
Uid | Sets user owner for the file or directory. |
Gid | Sets group owner for the file or directory. |
Permissions | Sets file or directory permissions. |
AccessTime | Sets last access time. |
ModificationTime | Sets last modification time. |
public Sub SetAttributes(ByVal Permissions As Int64)
The SetAttributes(Permissions) syntax has these parts:
public Sub SetAttributes(ByVal Size As UInt64)
The SetAttributes(Size) syntax has these parts:
public Sub SetAttributes(ByVal Uid As Int64, ByVal Gid As Int64)
The SetAttributes(Uid,Gid) syntax has these parts:
public Sub SetAttributes(ByVal AccessTime As DateTime, ByVal ModificationTime As DateTime)
The SetAttributes(AccessTime,ModificationTime) syntax has these parts:
public Sub SetAttributes(ByVal RemotePath As String, ByVal Permissions As Int64)
The SetAttributes(RemotePath,Permissions) syntax has these parts:
public Sub SetAttributes(ByVal RemotePath As String, ByVal Size As UInt64)
The SetAttributes(RemotePath,Size) syntax has these parts:
public Sub SetAttributes(ByVal RemotePath As String, ByVal Uid As Int64, ByVal Gid As Int64)
The SetAttributes(RemotePath,Uid,Gid) syntax has these parts:
public Sub SetAttributes(ByVal RemotePath As String, ByVal AccessTime As DateTime, ByVal ModificationTime As DateTime)
The SetAttributes(RemotePath,AccessTime,ModificationTime) syntax has these parts:
public Sub SetAttributes(ByVal Size As UInt64, ByVal Uid As Int64, ByVal Gid As Int64, ByVal Permissions As Int64, ByVal AccessTime As DateTime, ByVal ModificationTime As DateTime)
The SetAttributes(Size,Uid,Gid,Permissions,AccessTime,ModificationTime) syntax has these parts:
public Sub SetAttributes(ByVal RemotePath As String, ByVal Size As UInt64, ByVal Uid As Int64, ByVal Gid As Int64, ByVal Permissions As Int64, ByVal AccessTime As DateTime, ByVal ModificationTime As DateTime)
The SetAttributes(RemotePath,Size,Uid,Gid,Permissions,AccessTime,ModificationTime) syntax has these parts:
The SetAttributes(Permissions) syntax has these parts:
Permissions | Sets file or directory permissions. |
public Sub SetAttributes(ByVal Size As UInt64)
The SetAttributes(Size) syntax has these parts:
Size | New file size. You can truncate file to 0, or set it to any size of your choice. |
public Sub SetAttributes(ByVal Uid As Int64, ByVal Gid As Int64)
The SetAttributes(Uid,Gid) syntax has these parts:
Uid | Sets user owner for the file or directory. |
Gid | Sets group owner for the file or directory. |
public Sub SetAttributes(ByVal AccessTime As DateTime, ByVal ModificationTime As DateTime)
The SetAttributes(AccessTime,ModificationTime) syntax has these parts:
AccessTime | Sets last access time. |
ModificationTime | Sets last modification time. |
public Sub SetAttributes(ByVal RemotePath As String, ByVal Permissions As Int64)
The SetAttributes(RemotePath,Permissions) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
Permissions | Sets file or directory permissions. |
public Sub SetAttributes(ByVal RemotePath As String, ByVal Size As UInt64)
The SetAttributes(RemotePath,Size) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
Size | New file size. You can truncate file to 0, or set it to any size of your choice. |
public Sub SetAttributes(ByVal RemotePath As String, ByVal Uid As Int64, ByVal Gid As Int64)
The SetAttributes(RemotePath,Uid,Gid) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
Uid | Sets user owner for the file or directory. |
Gid | Sets group owner for the file or directory. |
public Sub SetAttributes(ByVal RemotePath As String, ByVal AccessTime As DateTime, ByVal ModificationTime As DateTime)
The SetAttributes(RemotePath,AccessTime,ModificationTime) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
AccessTime | Sets last access time. |
ModificationTime | Sets last modification time. |
public Sub SetAttributes(ByVal Size As UInt64, ByVal Uid As Int64, ByVal Gid As Int64, ByVal Permissions As Int64, ByVal AccessTime As DateTime, ByVal ModificationTime As DateTime)
The SetAttributes(Size,Uid,Gid,Permissions,AccessTime,ModificationTime) syntax has these parts:
Size | New file size. You can truncate file to 0, or set it to any size of your choice. |
Uid | Sets user owner for the file or directory. |
Gid | Sets group owner for the file or directory. |
Permissions | Sets file or directory permissions. |
AccessTime | Sets last access time. |
ModificationTime | Sets last modification time. |
public Sub SetAttributes(ByVal RemotePath As String, ByVal Size As UInt64, ByVal Uid As Int64, ByVal Gid As Int64, ByVal Permissions As Int64, ByVal AccessTime As DateTime, ByVal ModificationTime As DateTime)
The SetAttributes(RemotePath,Size,Uid,Gid,Permissions,AccessTime,ModificationTime) syntax has these parts:
RemotePath | Full path to file on remote server whose attributes should be set. |
Size | New file size. You can truncate file to 0, or set it to any size of your choice. |
Uid | Sets user owner for the file or directory. |
Gid | Sets group owner for the file or directory. |
Permissions | Sets file or directory permissions. |
AccessTime | Sets last access time. |
ModificationTime | Sets last modification time. |
Remarks
SetAttributes method is used to set certain attributes for the file or directory on the server. If RemotePath is not set, then RemotePath property will be used as file/directory name whose attributes are set. IMPORTANT thing to remember is: if you set file UID, set GID also in same function call (and vice versa). This is the way of setting attributes work. Same applies to setting AccessTime and ModificationTime. If you omit any of these parameters (and set the other one), it will be set to 0 (representing Jan 1, 1970). If you want to set only one of these parameters, you should first retrieve file/directory attributes and use those values in this method.The value for Permissions is defined by POSIX standard, meaning (in short) the following: - you should represent them in octal base system (base 8) to parse them easier. Permissions AND 777 (octal) will give you read/write/execute permissions for owner, group and others. To be more precise, 1 means execute permission, 2 means write permission, 4 means read permission. For example, if file Permission AND 777 (octal) is 754, this is represented on the server as -rwxr-xr-- which means following: owner can read/write/execute, group can read/execute, and others can only read. To determine if attribute belongs to directory, test for Permissions AND 40000 (octal). To determine if attribute belongs to symbolic link, test for Permissions AND 120000 (octal).