public Dirent[] GetEntries()
        {
            Dirent[] direntArray;
            IntPtr   intPtr = Syscall.opendir(base.FullPath);

            if (intPtr == IntPtr.Zero)
            {
                UnixMarshal.ThrowExceptionForLastError();
            }
            bool flag = false;

            try
            {
                Dirent[] entries = UnixDirectoryInfo.GetEntries(intPtr);
                flag        = true;
                direntArray = entries;
            }
            finally
            {
                int num = Syscall.closedir(intPtr);
                if (flag)
                {
                    UnixMarshal.ThrowExceptionForLastErrorIf(num);
                }
            }
            return(direntArray);
        }
        public Dirent[] GetEntries(Regex regex)
        {
            Dirent[] entries;
            IntPtr   intPtr = Syscall.opendir(base.FullPath);

            if (intPtr == IntPtr.Zero)
            {
                UnixMarshal.ThrowExceptionForLastError();
            }
            try
            {
                entries = UnixDirectoryInfo.GetEntries(intPtr, regex);
            }
            finally
            {
                UnixMarshal.ThrowExceptionForLastErrorIf(Syscall.closedir(intPtr));
            }
            return(entries);
        }