StatHandler Class


class StatHandler : public HandlerBase (.. public RefCountable, public NoCopy)
  bool Success() const;
  FileAttrs GetFileAttrs() const;
  SftpErr GetError() const;

  virtual void OnStart();
  virtual void OnDone();
  virtual void OnStat(FileAttrs const& fileAttrs);
  virtual void OnError(SftpErr const& error);


public class StatHandler : IDisposable, HandlerBase (.. WaitImpl)
  public bool Success { get; }
  public SftpErr GetError();
  public event StartEventHandler OnStart;
  public event DoneEventHandler OnDone;
  public event StatEventHandler OnStat;
  public event SftpErrorEventHandler OnError;
  public override sealed bool IsDisposed { get; }
  public override sealed void Dispose();



  • Success: Request completed successfully?
  • GetFileAttrs: Returns a FileAttrs with information about the requested file.
  • GetError: Returns a SftpErr.

Overrides and Events

  • OnStart: The first override/event being invoked for a request. *
  • OnDone: The last override/event being invoked for a request. *
  • OnStat: Invoked to pass the received file information to you.
    • fileAttrs: See GetFileAttrs().
  • OnError: Invoked for a failed request.
    • error: See GetError().

[.NET] Disposing

  • IsDisposed: Is the object disposed?
  • Dispose: Release all resources used by the object.


This handler is used with with the [ClientSftpChannel]Stat request.

* [C++] Always call the base class implementation from your override.