예제 #1
0
        public Nfs3FileSystemInfoResult FileSystemInfo(Nfs3FileHandle fileHandle)
        {
            MemoryStream  ms     = new MemoryStream();
            XdrDataWriter writer = StartCallMessage(ms, _client.Credentials, 19);

            fileHandle.Write(writer);

            RpcReply reply = DoSend(ms);

            if (reply.Header.IsSuccess)
            {
                Nfs3FileSystemInfoResult fsiReply = new Nfs3FileSystemInfoResult(reply.BodyReader);
                if (fsiReply.Status == Nfs3Status.Ok)
                {
                    return(fsiReply);
                }
                else
                {
                    throw new Nfs3Exception(fsiReply.Status);
                }
            }
            else
            {
                throw new RpcException(reply.Header.ReplyHeader);
            }
        }
        public bool Equals(Nfs3FileSystemInfoResult other)
        {
            if (other == null)
            {
                return(false);
            }

            return(other.Status == Status &&
                   object.Equals(other.PostOpAttributes, PostOpAttributes) &&
                   other.Status == Status &&
                   object.Equals(other.FileSystemInfo, FileSystemInfo));
        }
        public Nfs3Client(string address, RpcCredentials credentials, string mountPoint)
        {
            _rpcClient   = new RpcClient(address, credentials);
            _mountClient = new Nfs3Mount(_rpcClient);
            _rootHandle  = _mountClient.Mount(mountPoint).FileHandle;

            _nfsClient = new Nfs3(_rpcClient);

            Nfs3FileSystemInfoResult fsiResult = _nfsClient.FileSystemInfo(_rootHandle);

            _fsInfo           = fsiResult.FileSystemInfo;
            _cachedAttributes = new Dictionary <Nfs3FileHandle, Nfs3FileAttributes>();
            _cachedAttributes[_rootHandle] = fsiResult.PostOpAttributes;
        }
예제 #4
0
        public Nfs3Client(IRpcClient rpcClient, string mountPoint)
        {
            _rpcClient   = rpcClient;
            _mountClient = new Nfs3Mount(_rpcClient);
            RootHandle   = _mountClient.Mount(mountPoint).FileHandle;

            _nfsClient = new Nfs3(_rpcClient);

            Nfs3FileSystemInfoResult fsiResult = _nfsClient.FileSystemInfo(RootHandle);

            FileSystemInfo                = fsiResult.FileSystemInfo;
            _cachedAttributes             = new Dictionary <Nfs3FileHandle, Nfs3FileAttributes>();
            _cachedAttributes[RootHandle] = fsiResult.PostOpAttributes;
            _cachedStats = new Dictionary <Nfs3FileHandle, Nfs3FileSystemStat>();
        }
예제 #5
0
파일: Nfs3.cs 프로젝트: alexcmd/DiscUtils
        public Nfs3FileSystemInfoResult FileSystemInfo(Nfs3FileHandle fileHandle)
        {
            MemoryStream ms = new MemoryStream();
            XdrDataWriter writer = StartCallMessage(ms, _client.Credentials, 19);
            fileHandle.Write(writer);

            RpcReply reply = DoSend(ms);
            if (reply.Header.IsSuccess)
            {
                Nfs3FileSystemInfoResult fsiReply = new Nfs3FileSystemInfoResult(reply.BodyReader);
                if (fsiReply.Status == Nfs3Status.Ok)
                {
                    return fsiReply;
                }
                else
                {
                    throw new Nfs3Exception(fsiReply.Status);
                }
            }
            else
            {
                throw new RpcException(reply.Header.ReplyHeader);
            }
        }