Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 13 of 13 for readDirFn (6.35 sec)

  1. cmd/is-dir-empty_other.go

    package cmd
    
    // isDirEmpty - returns true if there is no error and no object and prefix inside this directory
    func isDirEmpty(dirname string, _ bool) bool {
    	entries, err := readDirN(dirname, 1)
    	if err != nil {
    		return false
    	}
    	return len(entries) == 0
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 05 15:17:08 GMT 2024
    - 1K bytes
    - Viewed (0)
  2. cmd/os-readdir-common.go

    func readDir(dirPath string) (entries []string, err error) {
    	return readDirWithOpts(dirPath, readDirOpts{count: -1})
    }
    
    // Return up to count entries at the directory dirPath.
    func readDirN(dirPath string, count int) (entries []string, err error) {
    	return readDirWithOpts(dirPath, readDirOpts{count: count})
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Jul 09 23:20:51 GMT 2021
    - 1.3K bytes
    - Viewed (0)
  3. cmd/os-readdir_test.go

    			err := os.WriteFile(filepath.Join(dir, fmt.Sprintf("%d", c)), []byte{}, os.ModePerm)
    			if err != nil {
    				os.RemoveAll(dir)
    				t.Fatalf("Unable to create a file, %s", err)
    			}
    		}
    		entries, err := readDirN(dir, testCase.n)
    		if err != nil {
    			os.RemoveAll(dir)
    			t.Fatalf("Unable to read entries, %s", err)
    		}
    		if len(entries) != testCase.expectedNum {
    			os.RemoveAll(dir)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 7.5K bytes
    - Viewed (0)
Back to top