Back to product page

GetAttributes method


Retrieves file or folder attributes.

Type

Void

Syntax

  • C#
  • VB.NET
public Void GetAttributes();

public Void GetAttributes(Boolean FollowSymLink);
The GetAttributes(FollowSymLink) syntax has these parts:
FollowSymLinkDetermines if symbolic link is resolved to real file on the server.

public Void GetAttributes(String RemotePath);
The GetAttributes(RemotePath) syntax has these parts:
RemotePathFull path to file or directory whose attributes should be obtained.

public Void GetAttributes(String RemotePath, Boolean FollowSymLink);
The GetAttributes(RemotePath,FollowSymLink) syntax has these parts:
RemotePathFull path to file or directory whose attributes should be obtained.
FollowSymLinkDetermines if symbolic link is resolved to real file on the server.

public Sub GetAttributes()

public Sub GetAttributes(ByVal FollowSymLink As Boolean)
The GetAttributes(FollowSymLink) syntax has these parts:
FollowSymLinkDetermines if symbolic link is resolved to real file on the server.

public Sub GetAttributes(ByVal RemotePath As String)
The GetAttributes(RemotePath) syntax has these parts:
RemotePathFull path to file or directory whose attributes should be obtained.

public Sub GetAttributes(ByVal RemotePath As String, ByVal FollowSymLink As Boolean)
The GetAttributes(RemotePath,FollowSymLink) syntax has these parts:
RemotePathFull path to file or directory whose attributes should be obtained.
FollowSymLinkDetermines if symbolic link is resolved to real file on the server.

Remarks

GetAttributes method will retrieve known information about file or directory on the remote server. Once these attributes are returned by the server, Attributes event is fired containing parsed information.

This method will provide you with information about:
Size as long
Uid as long
Gid as long
Permissions as long
AccessTime as DateTime
ModificationTime as DateTime


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).

Platforms

Windows