Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 974 for getwd (0.04 sec)

  1. src/go/build/build_test.go

    	}
    }
    
    func TestLocalDirectory(t *testing.T) {
    	if runtime.GOOS == "ios" {
    		t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
    	}
    
    	cwd, err := os.Getwd()
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	p, err := ImportDir(cwd, 0)
    	if err != nil {
    		t.Fatal(err)
    	}
    	if p.ImportPath != "go/build" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 15 16:24:01 UTC 2023
    - 23.9K bytes
    - Viewed (0)
  2. src/net/http/cgi/host_test.go

    	}
    }
    
    func TestDir(t *testing.T) {
    	testenv.MustHaveExec(t)
    	cwd, _ := os.Getwd()
    	h := &Handler{
    		Path: os.Args[0],
    		Root: "/test.cgi",
    		Dir:  cwd,
    	}
    	expectedMap := map[string]string{
    		"cwd": cwd,
    	}
    	runCgiTest(t, h, "GET /test.cgi HTTP/1.0\nHost: example.com\n\n", expectedMap)
    
    	cwd, _ = os.Getwd()
    	cwd, _ = filepath.Split(os.Args[0])
    	h = &Handler{
    		Path: os.Args[0],
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 18:29:59 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. src/io/fs/walk_test.go

    	if err != nil {
    		*errors = append(*errors, err)
    		if clear {
    			return nil
    		}
    		return err
    	}
    	return nil
    }
    
    func TestWalkDir(t *testing.T) {
    	tmpDir := t.TempDir()
    
    	origDir, err := os.Getwd()
    	if err != nil {
    		t.Fatal("finding working dir:", err)
    	}
    	if err = os.Chdir(tmpDir); err != nil {
    		t.Fatal("entering temp dir:", err)
    	}
    	defer os.Chdir(origDir)
    
    	fsys := makeTree()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 18 15:21:18 UTC 2022
    - 3K bytes
    - Viewed (0)
  4. src/net/http/cgi/cgi_main.go

    	keys = make([]string, 0, len(envs))
    	for k := range envs {
    		keys = append(keys, k)
    	}
    	slices.Sort(keys)
    	for _, key := range keys {
    		fmt.Printf("env-%s=%s\r\n", key, envs[key])
    	}
    
    	cwd, _ := os.Getwd()
    	fmt.Printf("cwd=%s\r\n", cwd)
    }
    
    type neverEnding byte
    
    func (b neverEnding) Read(p []byte) (n int, err error) {
    	for i := range p {
    		p[i] = byte(b)
    	}
    	return len(p), nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  5. src/cmd/internal/objabi/line.go

    	"strings"
    )
    
    // WorkingDir returns the current working directory
    // (or "/???" if the directory cannot be identified),
    // with "/" as separator.
    func WorkingDir() string {
    	var path string
    	path, _ = os.Getwd()
    	if path == "" {
    		path = "/???"
    	}
    	return filepath.ToSlash(path)
    }
    
    // AbsFile returns the absolute filename for file in the given directory,
    // as rewritten by the rewrites argument.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 23:10:31 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  6. test/linkobj.go

    	"log"
    	"os"
    	"os/exec"
    	"strings"
    )
    
    var pwd, tmpdir string
    
    func main() {
    	dir, err := ioutil.TempDir("", "go-test-linkobj-")
    	if err != nil {
    		log.Fatal(err)
    	}
    	pwd, err = os.Getwd()
    	if err != nil {
    		log.Fatal(err)
    	}
    	if err := os.Chdir(dir); err != nil {
    		os.RemoveAll(dir)
    		log.Fatal(err)
    	}
    	tmpdir = dir
    
    	writeFile("p1.go", `
    		package p1
    
    		func F() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/admission/config.go

    	apiserverv1 "k8s.io/apiserver/pkg/apis/apiserver/v1"
    )
    
    func makeAbs(path, base string) (string, error) {
    	if filepath.IsAbs(path) {
    		return path, nil
    	}
    	if len(base) == 0 || base == "." {
    		cwd, err := os.Getwd()
    		if err != nil {
    			return "", err
    		}
    		base = cwd
    	}
    	return filepath.Join(base, path), nil
    }
    
    // ReadAdmissionConfiguration reads the admission configuration at the specified path.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 29 15:48:39 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  8. src/os/removeall_test.go

    	case "aix", "darwin", "ios", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "illumos", "solaris":
    		break
    	default:
    		t.Skip("skipping for not implemented platforms")
    	}
    
    	prevDir, err := Getwd()
    	if err != nil {
    		t.Fatalf("Could not get wd: %s", err)
    	}
    
    	startPath, err := MkdirTemp("", "TestRemoveAllLongPath-")
    	if err != nil {
    		t.Fatalf("Could not create TempDir: %s", err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:29 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  9. pkg/volume/util/hostutil/hostutil_test.go

    	// Switch to volume path and create the socket file
    	// socket file can not have length of more than 108 character
    	// and hence we must use relative path
    	oldDir, _ := os.Getwd()
    
    	err := os.Chdir(socketDir)
    	if err != nil {
    		return "", err
    	}
    	defer func() {
    		os.Chdir(oldDir)
    	}()
    	_, socketCreateError := net.Listen("unix", "mt.sock")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 01 16:02:07 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  10. src/cmd/pack/pack_test.go

    	ar.addFile(helloFile.Reset())
    	ar.addFile(goodbyeFile.Reset())
    	ar.a.File().Close()
    	// Now extract one file. We chdir to the directory of the archive for simplicity.
    	pwd, err := os.Getwd()
    	if err != nil {
    		t.Fatal("os.Getwd: ", err)
    	}
    	err = os.Chdir(dir)
    	if err != nil {
    		t.Fatal("os.Chdir: ", err)
    	}
    	defer func() {
    		err := os.Chdir(pwd)
    		if err != nil {
    			t.Fatal("os.Chdir: ", err)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 16:27:35 UTC 2023
    - 12.5K bytes
    - Viewed (0)
Back to top