Back to FlowSsh Documentation

FileAttrs Structure/Class

[C]

struct FlowSshC_FileAttrs
{
  unsigned int m_validAttrFlags;
  unsigned char m_type;
  unsigned __int64 m_size;
  unsigned int m_uid;
  unsigned int m_gid;
  unsigned int m_permissions;
  unsigned __int64 m_accessTime;
  unsigned int m_accessTimeNs;
  unsigned __int64 m_createTime;
  unsigned int m_createTimeNs;
  unsigned __int64 m_modifyTime;
  unsigned int m_modifyTimeNs;
  wchar_t const* m_owner;
  wchar_t const* m_group;
  unsigned __int64 m_allocSize;
  unsigned char m_textHint;
}

[C++]

struct FileAttrs
{
  unsigned int m_validAttrFlags;
  unsigned char m_type;
  unsigned __int64 m_size;
  unsigned int m_uid;
  unsigned int m_gid;
  unsigned int m_permissions;
  unsigned __int64 m_accessTime;
  unsigned int m_accessTimeNs;
  unsigned __int64 m_createTime;
  unsigned int m_createTimeNs;
  unsigned __int64 m_modifyTime;
  unsigned int m_modifyTimeNs;
  std::wstring m_owner;
  std::wstring m_group;
  unsigned __int64 m_allocSize;
  unsigned char m_textHint;
}

[C#]

public sealed class FileAttrs
{
  public AttrFlags ValidAttrFlags;
  public FileType Type;       // Always present
  public ulong Size;          // AttrFlags.Size
  public uint Uid;            // AttrFlags.UidGid
  public uint Gid;            // AttrFlags.UidGid
  public uint Permissions;    // AttrFlags.Permissions
  public DateTime AccessTime; // AttrFlags.AccessTime
  public DateTime CreateTime; // AttrFlags.CreateTime
  public DateTime ModifyTime; // AttrFlags.ModifyTime
  public string Owner;        // AttrFlags.OwnerGroup
  public string Group;        // AttrFlags.OwnerGroup
  public ulong AllocSize;     // AttrFlags.AllocSize
  public TextHint TextHint;   // AttrFlags.TextHint
}

Members

  • ValidAttrFlags: AttrFlags bitflag defining which file attributes (members of this struct) are available.
  • Type: FileType enumeration. This member is always present.
  • Size: Number of bytes that can be read from the file (location of the end-of-file). Available if [AttrFlags]Size is set.
  • Uid: 32-bit unsigned integer representing the user/owner of the file. Available if [AttrFlags]UidGid is set.
  • Gid: 32-bit unsigned integer representing the group of the file. Available if [AttrFlags]UidGid is set.
  • Permissions: Bitflag specifying POSIX permissions for the file. Available if [AttrFlags]Permissions is set.
  • AccessTime: The last access time of the file. Available if [AttrFlags]AccessTime is set. *
  • CreateTime: The creation time of the file. Available if [AttrFlags]CreateTime is set. *
  • ModifyTime: The last time the file was written. Available if [AttrFlags]ModifyTime is set. *
  • Owner: Owner of the file represented by a string, for example "user@computer". Available if [AttrFlags]OwnerGroup is set.
  • Group: Group of the file represented by a string. Available if [AttrFlags]OwnerGroup is set.
  • AllocSize: Number of bytes that the file consumes on disk. Usually it will be larger than the Size field because most file-systems allocate space on disks on a sector boundary. For 'sparse' files however this field might also be less than than the Size field. Available if [AttrFlags]AllocSize is set.
  • TextHint: TextHint enumeration. Available if [AttrFlags]TextHint is set.
  • [C/Cpp] m_accessTimeNs: Nanoseconds to be added to the AccessTime. Available if [AttrFlags]AccessTime and [AttrFlags]Subseconds are set.
  • [C/Cpp] m_createTimeNs: Nanoseconds to be added to the CreateTime. Available if [AttrFlags]CreateTime and [AttrFlags]Subseconds are set.
  • [C/Cpp] m_modifyTimeNs: Nanoseconds to be added to the ModifyTime. Available if [AttrFlags]ModifyTime and [AttrFlags]Subseconds are set.

Remarks

This structure/class defines file attributes. It is used with the [ClientSftpChannel]SetStat and [ClientSftpChannel]MkDir requests, as well as by the list and stat handlers.

* [C/Cpp] Member contains the number of seconds from Jan 1, 1970 in UTC.
* [Net] If the [AttrFlags]Subseconds flag is set, then DateTime also contains milliseconds.