Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 114 for isAbs (1.06 sec)

  1. cmd/kubeadm/app/apis/kubeadm/validation/util_windows.go

    limitations under the License.
    */
    
    package validation
    
    import (
    	"path/filepath"
    )
    
    func isAbs(path string) bool {
    	// 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).
    	return filepath.IsAbs(path) || (len(path) > 0 && (path[0] == '\\' || path[0] == '/'))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Aug 26 13:03:13 UTC 2022
    - 987 bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. src/path/filepath/example_unix_test.go

    	// .
    	// .
    	// /
    	// .
    }
    
    func ExampleIsAbs() {
    	fmt.Println("On Unix:")
    	fmt.Println(filepath.IsAbs("/home/gopher"))
    	fmt.Println(filepath.IsAbs(".bashrc"))
    	fmt.Println(filepath.IsAbs(".."))
    	fmt.Println(filepath.IsAbs("."))
    	fmt.Println(filepath.IsAbs("/"))
    	fmt.Println(filepath.IsAbs(""))
    
    	// Output:
    	// On Unix:
    	// true
    	// false
    	// false
    	// false
    	// true
    	// false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 3.4K bytes
    - Viewed (0)
  5. 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)
  6. cmd/kubeadm/app/apis/kubeadm/validation/util_unix.go

    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package validation
    
    import (
    	"path/filepath"
    )
    
    func isAbs(path string) bool {
    	return filepath.IsAbs(path)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Aug 26 13:03:13 UTC 2022
    - 722 bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. src/cmd/go/internal/base/env.go

    // if one or more elements of dir is a symlink.
    func AppendPWD(base []string, dir string) []string {
    	// POSIX requires PWD to be absolute.
    	// Internally we only use absolute paths, so dir should already be absolute.
    	if !filepath.IsAbs(dir) {
    		panic(fmt.Sprintf("AppendPWD with relative path %q", dir))
    	}
    	return append(base, "PWD="+dir)
    }
    
    // AppendPATH returns the result of appending PATH=$GOROOT/bin:$PATH
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 25 16:40:59 UTC 2022
    - 1.3K bytes
    - Viewed (0)
Back to top