private void ReadDir(rpcCracker cracker, rpcPacker packer) { fhandle fh = new fhandle(cracker); uint cookie = cracker.get_uint32(); uint count = cracker.get_uint32(); FileEntry dir = FileTable.LookupFileEntry(fh); //Console.WriteLine("ReadDir:{0}, cookie:{1}, count:{2}, resultsNULL:{3}", dir.Name, cookie, count, results == null); if (cookie == 0 || results == null) { if (dir == null) { throw new NFSStatusException(NFSStatus.NFSERR_EXIST); } try { results = new readdirres(dir.Name, count); } catch (DirectoryNotFoundException) { FileTable.Remove(fh); throw; } } if (results.Pack(packer, cookie, count) == true) { results = null; } }
private void ReadDir(rpcCracker cracker, rpcPacker packer) { fhandle fh = new fhandle(cracker); uint cookie = cracker.get_uint32(); uint count = cracker.get_uint32(); FileEntry dir = FileTable.LookupFileEntry(fh); //Console.WriteLine("ReadDir:{0}, cookie:{1}, count:{2}, resultsNULL:{3}", dir.Name, cookie, count, results == null); if (cookie == 0 || results == null) { if (dir == null) throw new NFSStatusException(NFSStatus.NFSERR_EXIST); try { results = new readdirres(dir.Name, count); } catch(DirectoryNotFoundException) { FileTable.Remove(fh); throw; } } if (results.Pack(packer, cookie, count) == true) results = null; }