Esempio n. 1
0
        public Nfs3ReadDirPlusResult ReadDirPlus(Nfs3FileHandle dir, ulong cookie, byte[] cookieVerifier, uint dirCount, uint maxCount)
        {
            MemoryStream  ms     = new MemoryStream();
            XdrDataWriter writer = StartCallMessage(ms, _client.Credentials, 17);

            dir.Write(writer);
            writer.Write(cookie);
            writer.WriteBytes(cookieVerifier ?? new byte[Nfs3.CookieVerifierSize]);
            writer.Write(dirCount);
            writer.Write(maxCount);

            RpcReply reply = DoSend(ms);

            if (reply.Header.IsSuccess)
            {
                return(new Nfs3ReadDirPlusResult(reply.BodyReader));
            }
            else
            {
                throw new RpcException(reply.Header.ReplyHeader);
            }
        }
Esempio n. 2
0
        public Nfs3WriteResult Write(Nfs3FileHandle handle, long position, byte[] buffer, int bufferOffset, int count)
        {
            MemoryStream  ms     = new MemoryStream();
            XdrDataWriter writer = StartCallMessage(ms, _client.Credentials, 7);

            handle.Write(writer);
            writer.Write(position);
            writer.Write(count);
            writer.Write((int)0); // UNSTABLE
            writer.WriteBuffer(buffer, bufferOffset, count);

            RpcReply reply = DoSend(ms);

            if (reply.Header.IsSuccess)
            {
                return(new Nfs3WriteResult(reply.BodyReader));
            }
            else
            {
                throw new RpcException(reply.Header.ReplyHeader);
            }
        }