Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 79 for isAbs (0.04 sec)

  1. pkg/util/filesystem/util_windows_test.go

    	wg.Wait()
    	unixln.Close()
    }
    
    func TestAbsWithSlash(t *testing.T) {
    	// On Windows, filepath.IsAbs will not return True for paths prefixed with a slash
    	assert.True(t, IsAbs("/test"))
    	assert.True(t, IsAbs("\\test"))
    
    	assert.False(t, IsAbs("./local"))
    	assert.False(t, IsAbs("local"))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 09:10:26 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  2. pkg/util/filesystem/util_unix.go

    		return false, fmt.Errorf("stat file %s failed: %v", filePath, err)
    	}
    	if fi.Mode()&os.ModeSocket == 0 {
    		return false, nil
    	}
    	return true, nil
    }
    
    // IsAbs is same as filepath.IsAbs on Unix.
    func IsAbs(path string) bool {
    	return filepath.IsAbs(path)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 10 17:13:59 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  3. src/internal/filepathlite/path_plan9.go

    }
    
    func localize(path string) (string, error) {
    	if path[0] == '#' || bytealg.IndexByteString(path, 0) >= 0 {
    		return "", errInvalidPath
    	}
    	return path, nil
    }
    
    // IsAbs reports whether the path is absolute.
    func IsAbs(path string) bool {
    	return stringslite.HasPrefix(path, "/") || stringslite.HasPrefix(path, "#")
    }
    
    // volumeNameLen returns length of the leading volume name on Windows.
    // It returns 0 elsewhere.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 23:07:50 UTC 2024
    - 952 bytes
    - Viewed (0)
  4. src/internal/filepathlite/path_unix.go

    	return unixIsLocal(path)
    }
    
    func localize(path string) (string, error) {
    	if bytealg.IndexByteString(path, 0) >= 0 {
    		return "", errInvalidPath
    	}
    	return path, nil
    }
    
    // IsAbs reports whether the path is absolute.
    func IsAbs(path string) bool {
    	return stringslite.HasPrefix(path, "/")
    }
    
    // volumeNameLen returns length of the leading volume name on Windows.
    // It returns 0 elsewhere.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 23:07:50 UTC 2024
    - 935 bytes
    - Viewed (0)
  5. pkg/util/filesystem/util_windows.go

    			"filePath", filePath, "lastSocketErr", lastSocketErr, "err", err)
    		return false, nil
    	}
    	return true, nil
    }
    
    // IsAbs returns whether the given path is absolute or not.
    // On Windows, filepath.IsAbs will not return True for paths prefixed with a slash, even
    // though they can be used as absolute paths (https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats).
    //
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 10 17:13:59 UTC 2024
    - 4K bytes
    - Viewed (0)
  6. cmd/kubeadm/app/componentconfigs/kubelet_windows.go

    	// nodes, it would contain absolute paths that may lack drive letters, since the config
    	// could have been generated on a Linux control-plane node. On Windows the
    	// Golang filepath.IsAbs() function returns false unless the path contains a drive letter.
    	// This trips client-go and the kubelet, creating problems on Windows nodes.
    	// Fixing it in client-go or the kubelet is a breaking change to existing Windows
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 25 10:26:46 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  7. src/path/filepath/path.go

    // EvalSymlinks calls [Clean] on the result.
    func EvalSymlinks(path string) (string, error) {
    	return evalSymlinks(path)
    }
    
    // IsAbs reports whether the path is absolute.
    func IsAbs(path string) bool {
    	return filepathlite.IsAbs(path)
    }
    
    // Abs returns an absolute representation of path.
    // If the path is not absolute it will be joined with the current
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 15.5K bytes
    - Viewed (0)
  8. src/os/exec/lp_plan9.go

    			return "", &Error{file, err}
    		}
    	}
    
    	path := os.Getenv("path")
    	for _, dir := range filepath.SplitList(path) {
    		path := filepath.Join(dir, file)
    		if err := findExecutable(path); err == nil {
    			if !filepath.IsAbs(path) {
    				if execerrdot.Value() != "0" {
    					return path, &Error{file, ErrDot}
    				}
    				execerrdot.IncNonDefault()
    			}
    			return path, nil
    		}
    	}
    	return "", &Error{file, ErrNotFound}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:12 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  9. src/path/filepath/path_test.go

    		for _, test := range isabstests {
    			tests = append(tests, IsAbsTest{"c:" + test.path, test.isAbs})
    		}
    	} else {
    		tests = isabstests
    	}
    
    	for _, test := range tests {
    		if r := filepath.IsAbs(test.path); r != test.isAbs {
    			t.Errorf("IsAbs(%q) = %v, want %v", test.path, r, test.isAbs)
    		}
    	}
    }
    
    type EvalSymlinksTest struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:38:19 UTC 2024
    - 47.1K bytes
    - Viewed (0)
  10. src/os/exec/lp_unix.go

    		if dir == "" {
    			// Unix shell semantics: path element "" means "."
    			dir = "."
    		}
    		path := filepath.Join(dir, file)
    		if err := findExecutable(path); err == nil {
    			if !filepath.IsAbs(path) {
    				if execerrdot.Value() != "0" {
    					return path, &Error{file, ErrDot}
    				}
    				execerrdot.IncNonDefault()
    			}
    			return path, nil
    		}
    	}
    	return "", &Error{file, ErrNotFound}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:12 UTC 2024
    - 2.4K bytes
    - Viewed (0)
Back to top