Exemple #1
0
        /**
         * Call remote procedure NFSPROC_SETATTR_2.
         * @param arg1 parameter (of type sattrargs) to the remote procedure call.
         * @return Result from remote procedure call (of type attrstat).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */

        public FileStatus NFSPROC_SETATTR(FileArguments arg1)
        {
            FileStatus result_ = new FileStatus();

            client.call(NFSv2Protocol.NFSPROC_SETATTR, NFSv2Protocol.NFS_VERSION, arg1, result_);

            return(result_);
        }
        /**
         * Call remote procedure NFSPROC_SETATTR_2.
         * @param arg1 parameter (of type sattrargs) to the remote procedure call.
         * @return Result from remote procedure call (of type attrstat).
         * @throws OncRpcException if an ONC/RPC error occurs.
         * @throws IOException if an I/O error occurs.
         */
        public FileStatus NFSPROC_SETATTR(FileArguments arg1)
        {
            FileStatus result_ = new FileStatus();

            client.call(NFSv2Protocol.NFSPROC_SETATTR, NFSv2Protocol.NFS_VERSION, arg1, result_);

            return result_;
        }
Exemple #3
0
        public void SetFileSize(string FileFullName, long Size)
        {
            if (_ProtocolV2 == null)
            { 
                throw new NFSConnectionException("NFS Client not connected!"); 
            }

            if (_MountProtocolV2 == null)
            { 
                throw new NFSMountConnectionException("NFS Device not connected!"); 
            }

            NFSAttributes Attributes = GetItemAttributes(FileFullName);

            FileArguments dpArgSAttr = new FileArguments();
            dpArgSAttr.Attributes = new CreateAttributes();
            dpArgSAttr.Attributes.LastAccessedTime = new NFSTimeValue();
            dpArgSAttr.Attributes.LastAccessedTime.Seconds = -1;
            dpArgSAttr.Attributes.LastAccessedTime.UnixSeconds = -1;
            dpArgSAttr.Attributes.ModifiedTime = new NFSTimeValue();
            dpArgSAttr.Attributes.ModifiedTime.Seconds = -1;
            dpArgSAttr.Attributes.ModifiedTime.UnixSeconds = -1;
            dpArgSAttr.Attributes.Mode = new NFSPermission(0xff, 0xff, 0xff);
            dpArgSAttr.Attributes.UserID = -1;
            dpArgSAttr.Attributes.GroupID = -1;
            dpArgSAttr.Attributes.Size = (int)Size;
            dpArgSAttr.File = new NFSHandle(Attributes.Handle, V2.RPC.NFSv2Protocol.NFS_VERSION);

            FileStatus pAttrStat =
                _ProtocolV2.NFSPROC_SETATTR(dpArgSAttr);

            if (pAttrStat == null || pAttrStat.Status != NFSStats.NFS_OK)
            {
                if (pAttrStat == null)
                { 
                    throw new NFSGeneralException("NFSPROC_SETATTR: failure"); 
                }

                ExceptionHelpers.ThrowException(pAttrStat.Status);
            }
        }