Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 108 for isAbs (0.9 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/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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. src/cmd/go/internal/workcmd/use.go

    	workDir := filepath.Dir(gowork) // absolute, since gowork itself is absolute
    
    	haveDirs := make(map[string][]string) // absolute → original(s)
    	for _, use := range wf.Use {
    		var abs string
    		if filepath.IsAbs(use.Path) {
    			abs = filepath.Clean(use.Path)
    		} else {
    			abs = filepath.Join(workDir, use.Path)
    		}
    		haveDirs[abs] = append(haveDirs[abs], use.Path)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jun 03 21:13:11 UTC 2023
    - 7K bytes
    - Viewed (0)
Back to top