Contains File system information exposed by [email protected] request.
 protected void Act()
 {
     _actual = _sftpSession.RequestStatVfs("path");
 }
 public void SupportsSetUidTest()
 {
     ulong bsize = 0; // TODO: Initialize to an appropriate value
     ulong frsize = 0; // TODO: Initialize to an appropriate value
     ulong blocks = 0; // TODO: Initialize to an appropriate value
     ulong bfree = 0; // TODO: Initialize to an appropriate value
     ulong bavail = 0; // TODO: Initialize to an appropriate value
     ulong files = 0; // TODO: Initialize to an appropriate value
     ulong ffree = 0; // TODO: Initialize to an appropriate value
     ulong favail = 0; // TODO: Initialize to an appropriate value
     ulong sid = 0; // TODO: Initialize to an appropriate value
     ulong flag = 0; // TODO: Initialize to an appropriate value
     ulong namemax = 0; // TODO: Initialize to an appropriate value
     SftpFileSytemInformation target = new SftpFileSytemInformation(bsize, frsize, blocks, bfree, bavail, files, ffree, favail, sid, flag, namemax); // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.SupportsSetUid;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
示例#3
-1
        /// <summary>
        /// Performs [email protected] extended request.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <param name="nullOnError">if set to <c>true</c> [null on error].</param>
        /// <returns></returns>
        internal SftpFileSytemInformation RequestStatVfs(string path, bool nullOnError = false)
        {
            if (this.ProtocolVersion < 3)
            {
                throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "SSH_FXP_EXTENDED operation is not supported in {0} version that server operates in.", this.ProtocolVersion));
            }

            SshException exception = null;

            SftpFileSytemInformation information = null;

            using (var wait = new AutoResetEvent(false))
            {
                var request = new StatVfsRequest(this.ProtocolVersion, this.NextRequestId, path, this.Encoding,
                                                 (response) =>
                {
                    information = response.GetReply <StatVfsReplyInfo>().Information;

                    wait.Set();
                },
                                                 (response) =>
                {
                    exception = this.GetSftpException(response);
                    wait.Set();
                });

                if (!this._supportedExtensions.ContainsKey(request.Name))
                {
                    throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Extension method {0} currently not supported by the server.", request.Name));
                }

                this.SendRequest(request);

                this.WaitOnHandle(wait, this._operationTimeout);
            }

            if (!nullOnError && exception != null)
            {
                throw exception;
            }

            return(information);
        }