Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 974 for getwd (0.06 sec)

  1. src/syscall/syscall_solaris.go

    		return
    	}
    	return anyToSockaddr(&rsa)
    }
    
    const ImplementsGetwd = true
    
    //sys	Getcwd(buf []byte) (n int, err error)
    
    func Getwd() (wd string, err error) {
    	var buf [PathMax]byte
    	// Getcwd will return an error if it failed for any reason.
    	_, err = Getcwd(buf[0:])
    	if err != nil {
    		return "", err
    	}
    	n := clen(buf[:])
    	if n < 1 {
    		return "", EINVAL
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  2. src/internal/testenv/testenv.go

    		// GOROOT/src/go.mod, and we can report the parent directory of that.
    		//
    		// Notably, this works even if we can't run 'go env GOROOT' as a
    		// subprocess.
    
    		cwd, err := os.Getwd()
    		if err != nil {
    			gorootErr = fmt.Errorf("finding GOROOT: %w", err)
    			return
    		}
    
    		dir := cwd
    		for {
    			parent := filepath.Dir(dir)
    			if parent == dir {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 16:41:38 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  3. tools/bug-report/pkg/bugreport/bugreport.go

    	}
    
    	logRuntime(curTime, "Done with bug-report command before generating the archive file")
    
    	outDir, err := os.Getwd()
    	if err != nil {
    		log.Errorf("using ./ to write archive: %s", err.Error())
    		outDir = "."
    	}
    	if outputDir != "" {
    		outDir = outputDir
    	}
    	outPath := filepath.Join(outDir, "bug-report.tar.gz")
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 05 20:57:29 UTC 2024
    - 20.7K bytes
    - Viewed (0)
  4. src/path/filepath/path_windows_test.go

    		{".", `\\localhost\c$`, `\\localhost\c$`},
    	}
    
    	ctmp := tempDirCanonical(t)
    	if err := os.MkdirAll(strings.ReplaceAll(testPath, "{{tmp}}", ctmp), 0777); err != nil {
    		t.Fatal(err)
    	}
    
    	cwd, err := os.Getwd()
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer func() {
    		err := os.Chdir(cwd)
    		if err != nil {
    			t.Fatal(err)
    		}
    	}()
    
    	tmpVol := filepath.VolumeName(ctmp)
    	if len(tmpVol) != 2 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 20:38:54 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  5. src/os/os_windows_test.go

    // chdir changes the current working directory to the named directory,
    // and then restore the original working directory at the end of the test.
    func chdir(t *testing.T, dir string) {
    	olddir, err := os.Getwd()
    	if err != nil {
    		t.Fatalf("chdir: %v", err)
    	}
    	if err := os.Chdir(dir); err != nil {
    		t.Fatalf("chdir %s: %v", dir, err)
    	}
    
    	t.Cleanup(func() {
    		if err := os.Chdir(olddir); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 41.8K bytes
    - Viewed (0)
  6. src/syscall/fs_wasip1.go

    }
    
    func Ftruncate(fd int, length int64) error {
    	errno := fd_filestat_set_size(int32(fd), filesize(length))
    	return errnoErr(errno)
    }
    
    const ImplementsGetwd = true
    
    func Getwd() (string, error) {
    	return cwd, nil
    }
    
    func Chdir(path string) error {
    	if path == "" {
    		return EINVAL
    	}
    
    	dir := "/"
    	if !isAbs(path) {
    		dir = cwd
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 24.1K bytes
    - Viewed (0)
  7. src/syscall/syscall_linux_test.go

    	"testing"
    	"unsafe"
    )
    
    // chtmpdir changes the working directory to a new temporary directory and
    // provides a cleanup function. Used when PWD is read-only.
    func chtmpdir(t *testing.T) func() {
    	oldwd, err := os.Getwd()
    	if err != nil {
    		t.Fatalf("chtmpdir: %v", err)
    	}
    	d, err := os.MkdirTemp("", "test")
    	if err != nil {
    		t.Fatalf("chtmpdir: %v", err)
    	}
    	if err := os.Chdir(d); err != nil {
    		t.Fatalf("chtmpdir: %v", err)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 23K bytes
    - Viewed (0)
  8. src/cmd/doc/doc_test.go

    func TestDotSlashLookup(t *testing.T) {
    	if testing.Short() {
    		t.Skip("scanning file system takes too long")
    	}
    	maybeSkip(t)
    	where, err := os.Getwd()
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer func() {
    		if err := os.Chdir(where); err != nil {
    			t.Fatal(err)
    		}
    	}()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 07 19:16:55 UTC 2023
    - 31.2K bytes
    - Viewed (0)
  9. src/syscall/syscall_windows.go

    	Stderr = getStdHandle(STD_ERROR_HANDLE)
    )
    
    func getStdHandle(h int) (fd Handle) {
    	r, _ := GetStdHandle(h)
    	return r
    }
    
    const ImplementsGetwd = true
    
    func Getwd() (wd string, err error) {
    	b := make([]uint16, 300)
    	// The path of the current directory may not fit in the initial 300-word
    	// buffer when long path support is enabled. The current directory may also
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 11:49:46 UTC 2024
    - 52.7K bytes
    - Viewed (0)
  10. src/cmd/go/go_test.go

    			}
    		}
    	}
    	tg.inParallel = true
    	tg.t.Parallel()
    }
    
    // pwd returns the current directory.
    func (tg *testgoData) pwd() string {
    	tg.t.Helper()
    	wd, err := os.Getwd()
    	if err != nil {
    		tg.t.Fatalf("could not get working directory: %v", err)
    	}
    	return wd
    }
    
    // sleep sleeps for one tick, where a tick is a conservative estimate
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 81.1K bytes
    - Viewed (0)
Back to top