Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 119 for isAbs (0.67 sec)

  1. src/path/example_test.go

    }
    
    func ExampleExt() {
    	fmt.Println(path.Ext("/a/b/c/bar.css"))
    	fmt.Println(path.Ext("/"))
    	fmt.Println(path.Ext(""))
    	// Output:
    	// .css
    	//
    	//
    }
    
    func ExampleIsAbs() {
    	fmt.Println(path.IsAbs("/dev/null"))
    	// Output: true
    }
    
    func ExampleJoin() {
    	fmt.Println(path.Join("a", "b", "c"))
    	fmt.Println(path.Join("a", "b/c"))
    	fmt.Println(path.Join("a/b", "c"))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 19 00:10:22 UTC 2020
    - 2.2K bytes
    - Viewed (0)
  2. src/cmd/cover/func.go

    	// Run go list to find the location of every package we care about.
    	pkgs := make(map[string]*Pkg)
    	var list []string
    	for _, profile := range profiles {
    		if strings.HasPrefix(profile.FileName, ".") || filepath.IsAbs(profile.FileName) {
    			// Relative or absolute path.
    			continue
    		}
    		pkg := path.Dir(profile.FileName)
    		if _, ok := pkgs[pkg]; !ok {
    			pkgs[pkg] = nil
    			list = append(list, pkg)
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 17:49:12 UTC 2022
    - 6.3K bytes
    - Viewed (0)
  3. src/path/path.go

    		path = path[i+1:]
    	}
    	// If empty now, it had only slashes.
    	if path == "" {
    		return "/"
    	}
    	return path
    }
    
    // IsAbs reports whether the path is absolute.
    func IsAbs(path string) bool {
    	return len(path) > 0 && path[0] == '/'
    }
    
    // Dir returns all but the last element of path, typically the path's directory.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 23 17:33:57 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  4. 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)
  5. src/internal/filepathlite/path_windows.go

    			return false
    		}
    	}
    	return true
    }
    
    func toUpper(c byte) byte {
    	if 'a' <= c && c <= 'z' {
    		return c - ('a' - 'A')
    	}
    	return c
    }
    
    // IsAbs reports whether the path is absolute.
    func IsAbs(path string) (b bool) {
    	l := volumeNameLen(path)
    	if l == 0 {
    		return false
    	}
    	// If the volume name starts with a double slash, this is an absolute path.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 23:07:50 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  6. src/os/executable_test.go

    	}
    	cmd.Env = append(cmd.Environ(), fmt.Sprintf("%s=1", executable_EnvVar))
    	out, err := cmd.CombinedOutput()
    	if err != nil {
    		t.Fatalf("exec(self) failed: %v", err)
    	}
    	outs := string(out)
    	if !filepath.IsAbs(outs) {
    		t.Fatalf("Child returned %q, want an absolute path", out)
    	}
    	if !sameFile(outs, ep) {
    		t.Fatalf("Child returned %q, not the same file as %q", out, ep)
    	}
    }
    
    func sameFile(fn1, fn2 string) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:32 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  7. src/syscall/fs_wasip1.go

    	var dirFd = int32(-1)
    	var dirName string
    
    	dir := "/"
    	if !isAbs(path) {
    		dir = cwd
    	}
    	path = joinPath(dir, path)
    
    	for _, p := range preopens {
    		if len(p.name) > len(dirName) && stringslite.HasPrefix(path, p.name) {
    			dirFd, dirName = p.fd, p.name
    		}
    	}
    
    	path = path[len(dirName):]
    	for isAbs(path) {
    		path = path[1:]
    	}
    	if len(path) == 0 {
    		path = "."
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 24.1K bytes
    - Viewed (0)
  8. src/cmd/go/internal/cache/default.go

    	// otherwise distinguish between an explicit "off" and a UserCacheDir error.
    
    	defaultDirOnce.Do(func() {
    		defaultDir = cfg.Getenv("GOCACHE")
    		if defaultDir != "" {
    			defaultDirChanged = true
    			if filepath.IsAbs(defaultDir) || defaultDir == "off" {
    				return
    			}
    			defaultDir = "off"
    			defaultDirErr = fmt.Errorf("GOCACHE is not an absolute path")
    			return
    		}
    
    		// Compute default location.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 14:34:32 UTC 2024
    - 3K bytes
    - Viewed (0)
  9. pkg/kubelet/cm/util/cgroups_linux.go

    	// If we didn't mount the subsystem, there is no point we make the path.
    	if err != nil {
    		return "", err
    	}
    
    	// If the cgroup name/path is absolute do not look relative to the cgroup of the init process.
    	if filepath.IsAbs(cgroupPath) {
    		// Sometimes subsystems can be mounted together as 'cpu,cpuacct'.
    		return filepath.Join(root, mnt, cgroupPath), nil
    	}
    
    	parentPath, err := getCgroupV1ParentPath(mnt, root)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 12 07:50:19 UTC 2020
    - 2.9K bytes
    - Viewed (0)
  10. src/cmd/go/internal/envcmd/env.go

    		if strings.HasPrefix(val, "~") {
    			return fmt.Errorf("GOPATH entry cannot start with shell metacharacter '~': %q", val)
    		}
    		if !filepath.IsAbs(val) && val != "" {
    			return fmt.Errorf("GOPATH entry is relative; must be absolute path: %q", val)
    		}
    	case "GOMODCACHE":
    		if !filepath.IsAbs(val) && val != "" {
    			return fmt.Errorf("GOMODCACHE entry is relative; must be absolute path: %q", val)
    		}
    	case "CC", "CXX":
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 17:13:51 UTC 2024
    - 19.6K bytes
    - Viewed (0)
Back to top