示例#1
0
 /// <summary>
 /// Gets the folders exported by a server.
 /// </summary>
 /// <param name="address">The address of the server.</param>
 /// <returns>An enumeration of exported folders.</returns>
 public static IEnumerable <string> GetExports(string address)
 {
     using (RpcClient rpcClient = new RpcClient(address, null))
     {
         Nfs3Mount mountClient = new Nfs3Mount(rpcClient);
         foreach (var export in mountClient.Exports())
         {
             yield return(export.DirPath);
         }
     }
 }
示例#2
0
        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;
        }
        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
 /// <summary>
 /// Gets the folders exported by a server.
 /// </summary>
 /// <param name="address">The address of the server</param>
 /// <returns>An enumeration of exported folders</returns>
 public static IEnumerable<string> GetExports(string address)
 {
     using (RpcClient rpcClient = new RpcClient(address, null))
     {
         Nfs3Mount mountClient = new Nfs3Mount(rpcClient);
         foreach (var export in mountClient.Exports())
         {
             yield return export.DirPath;
         }
     }
 }