Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 658 for getwd (0.09 sec)

  1. pkg/test/framework/tools/featuresgen/cmd/root.go

    func createLabelsFromYaml() string {
    	data, err := os.ReadFile(input)
    	if err != nil {
    		pwd, _ := os.Getwd()
    		fmt.Println("Error running featuresgen on file: ", pwd, "/", input)
    		panic(err)
    	}
    	m := make(map[any]any)
    
    	err = yaml.Unmarshal(data, &m)
    	if err != nil {
    		pwd, _ := os.Getwd()
    		fmt.Println("Error running featuresgen on file: ", pwd, "/", input)
    		panic(err)
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 5.4K bytes
    - Viewed (0)
  2. src/os/executable_darwin.go

    package os
    
    import (
    	"errors"
    	_ "unsafe" // for linkname
    )
    
    //go:linkname executablePath
    var executablePath string // set by ../runtime/os_darwin.go
    
    var initCwd, initCwdErr = Getwd()
    
    func executable() (string, error) {
    	ep := executablePath
    	if len(ep) == 0 {
    		return ep, errors.New("cannot find executable path")
    	}
    	if ep[0] != '/' {
    		if initCwdErr != nil {
    			return ep, initCwdErr
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 675 bytes
    - Viewed (0)
  3. src/cmd/compile/internal/test/pgo_devirtualize_test.go

    	}
    }
    
    // TestPGODevirtualize tests that specific functions are devirtualized when PGO
    // is applied to the exact source that was profiled.
    func TestPGODevirtualize(t *testing.T) {
    	wd, err := os.Getwd()
    	if err != nil {
    		t.Fatalf("error getting wd: %v", err)
    	}
    	srcDir := filepath.Join(wd, "testdata", "pgo", "devirtualize")
    
    	// Copy the module to a scratch location so we can add a go.mod.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 15 21:30:35 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  4. src/cmd/go/internal/base/env.go

    package base
    
    import (
    	"cmd/go/internal/cfg"
    	"fmt"
    	"os"
    	"path/filepath"
    	"runtime"
    )
    
    // AppendPWD returns the result of appending PWD=dir to the environment base.
    //
    // The resulting environment makes os.Getwd more efficient for a subprocess
    // running in dir, and also improves the accuracy of paths relative to dir
    // if one or more elements of dir is a symlink.
    func AppendPWD(base []string, dir string) []string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 25 16:40:59 UTC 2022
    - 1.3K bytes
    - Viewed (0)
  5. src/os/file_open_wasip1.go

    	// os.(*File).Chdir is emulated by setting the working directory to the
    	// absolute path that this file was opened at, which is why we have to
    	// resolve and capture it here.
    	if filePath[0] != '/' {
    		wd, err := syscall.Getwd()
    		if err != nil {
    			return -1, poll.SysFile{}, err
    		}
    		absPath = joinPath(wd, filePath)
    	}
    	fd, err := syscall.Open(absPath, flag, perm)
    	return fd, poll.SysFile{Path: absPath}, err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 07 23:34:21 UTC 2023
    - 818 bytes
    - Viewed (0)
  6. src/os/path_windows.go

    	if !filepathlite.IsAbs(path) {
    		// If the path is relative, we need to prepend the working directory
    		// plus a separator to the path before we can determine if it's too long.
    		// We don't want to call syscall.Getwd here, as that call is expensive to do
    		// every time fixLongPath is called with a relative path, so we use a cache.
    		// Note that getwdCache might be outdated if the working directory has been
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 18:44:48 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  7. src/cmd/go/internal/base/path.go

    // UncachedCwd is appropriate to call early in program startup before flag parsing,
    // because the -C flag may change the current directory.
    func UncachedCwd() string {
    	wd, err := os.Getwd()
    	if err != nil {
    		Fatalf("cannot determine current directory: %v", err)
    	}
    	return wd
    }
    
    // Cwd returns the current working directory at the time of the first call.
    func Cwd() string {
    	cwdOnce.Do(func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 20 19:17:27 UTC 2023
    - 2K bytes
    - Viewed (0)
  8. cmd/gotemplate/gotemplate_test.go

    		},
    		"include": {
    			in:       `{{include "test.txt" | indent 2}}`,
    			files:    map[string]string{"test.txt": "hello\nworld"},
    			expected: "hello\n  world",
    		},
    	} {
    		cwd, err := os.Getwd()
    		require.NoError(t, err)
    
    		t.Run(name, func(t *testing.T) {
    			tmp := t.TempDir()
    			for fileName, fileContent := range tt.files {
    				err := os.WriteFile(path.Join(tmp, fileName), []byte(fileContent), 0666)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jan 22 13:43:42 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  9. src/runtime/testdata/testprog/syscalls_linux.go

    }
    
    func getcwd() (string, error) {
    	if !syscall.ImplementsGetwd {
    		return "", nil
    	}
    	// Use the syscall to get the current working directory.
    	// This is imperative for checking for OS thread state
    	// after an unshare since os.Getwd might just check the
    	// environment, or use some other mechanism.
    	var buf [4096]byte
    	n, err := syscall.Getcwd(buf[:])
    	if err != nil {
    		return "", err
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 20:00:09 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  10. src/os/executable_path.go

    //go:build aix || openbsd
    
    package os
    
    // We query the working directory at init, to use it later to search for the
    // executable file
    // errWd will be checked later, if we need to use initWd
    var initWd, errWd = Getwd()
    
    func executable() (string, error) {
    	var exePath string
    	if len(Args) == 0 || Args[0] == "" {
    		return "", ErrNotExist
    	}
    	if IsPathSeparator(Args[0][0]) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 2.3K bytes
    - Viewed (0)
Back to top