Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 232 for chdir (0.04 sec)

  1. test/linkobj.go

    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() {
    			println("hello from p1")
    		}
    	`)
    	writeFile("p2.go", `
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  2. src/os/exec_posix.go

    	// If there is no SysProcAttr (ie. no Chroot or changed
    	// UID/GID), double-check existence of the directory we want
    	// to chdir into. We can make the error clearer this way.
    	if attr != nil && attr.Sys == nil && attr.Dir != "" {
    		if _, err := Stat(attr.Dir); err != nil {
    			pe := err.(*PathError)
    			pe.Op = "chdir"
    			return nil, pe
    		}
    	}
    
    	sysattr := &syscall.ProcAttr{
    		Dir: attr.Dir,
    		Env: attr.Env,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/teststdio/stdio_test.go

    	// declaring the same path.
    	modRoot := filepath.Join(GOPATH, "src", "cgostdio")
    	if err := cgotest.OverlayDir(modRoot, "testdata"); err != nil {
    		log.Panic(err)
    	}
    	if err := os.Chdir(modRoot); err != nil {
    		log.Panic(err)
    	}
    	os.Setenv("PWD", modRoot)
    	if err := os.WriteFile("go.mod", []byte("module cgostdio\n"), 0666); err != nil {
    		log.Panic(err)
    	}
    
    	return m.Run()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 22 20:56:09 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  4. src/testing/internal/testdeps/deps.go

    	l.add("getenv", key)
    }
    
    func (l *testLog) Open(name string) {
    	l.add("open", name)
    }
    
    func (l *testLog) Stat(name string) {
    	l.add("stat", name)
    }
    
    func (l *testLog) Chdir(name string) {
    	l.add("chdir", name)
    }
    
    // add adds the (op, name) pair to the test log.
    func (l *testLog) add(op, name string) {
    	if strings.Contains(name, "\n") || name == "" {
    		return
    	}
    
    	l.mu.Lock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 14:01:23 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  5. src/cmd/doc/main.go

    	flagSet.BoolVar(&short, "short", false, "one-line representation for each symbol")
    	flagSet.Parse(args)
    	telemetry.Inc("doc/invocations")
    	telemetry.CountFlags("doc/flag:", *flag.CommandLine)
    	if chdir != "" {
    		if err := os.Chdir(chdir); err != nil {
    			return err
    		}
    	}
    	var paths []string
    	var symbol, method string
    	// Loop until something is printed.
    	dirs.Reset()
    	for i := 0; ; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  6. src/runtime/syscall2_solaris.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package runtime
    
    import _ "unsafe" // for go:linkname
    
    //go:cgo_import_dynamic libc_chdir chdir "libc.so"
    //go:cgo_import_dynamic libc_chroot chroot "libc.so"
    //go:cgo_import_dynamic libc_close close "libc.so"
    //go:cgo_import_dynamic libc_execve execve "libc.so"
    //go:cgo_import_dynamic libc_fcntl fcntl "libc.so"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 06 18:49:01 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  7. hack/boilerplate/boilerplate_test.py

    class TestBoilerplate(unittest.TestCase):
        """
        Note: run this test from the hack/boilerplate directory.
    
        $ python -m unittest boilerplate_test
        """
    
        def test_boilerplate(self):
            os.chdir("test/")
    
            class Args:
                filenames = []
                rootdir = "."
                boilerplate_dir = "../"
                verbose = True
    
            # capture stdout
            old_stdout = sys.stdout
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 24 09:05:26 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  8. src/os/exec/dot_test.go

    	// Not parallel: uses Chdir and Setenv.
    
    	tmpDir := filepath.Join(t.TempDir(), "testdir")
    	if err := os.Mkdir(tmpDir, 0777); err != nil {
    		t.Fatal(err)
    	}
    
    	executable := "execabs-test"
    	if runtime.GOOS == "windows" {
    		executable += ".exe"
    	}
    	if err := os.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0777); err != nil {
    		t.Fatal(err)
    	}
    	chdir(t, tmpDir)
    	t.Setenv("PWD", tmpDir)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 13 18:19:21 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py39.py

    from ...utils import needs_py39, needs_pydanticv1
    
    
    @pytest.fixture(scope="module")
    def client(tmp_path_factory: pytest.TempPathFactory):
        tmp_path = tmp_path_factory.mktemp("data")
        cwd = os.getcwd()
        os.chdir(tmp_path)
        test_db = Path("./sql_app.db")
        if test_db.is_file():  # pragma: nocover
            test_db.unlink()
        # Import while creating the client to create the DB after starting the test session
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Mar 13 19:07:10 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_sql_databases/test_sql_databases_py310.py

    
    @pytest.fixture(scope="module", name="client")
    def get_client(tmp_path_factory: pytest.TempPathFactory):
        tmp_path = tmp_path_factory.mktemp("data")
        cwd = os.getcwd()
        os.chdir(tmp_path)
        test_db = Path("./sql_app.db")
        if test_db.is_file():  # pragma: nocover
            test_db.unlink()
        # Import while creating the client to create the DB after starting the test session
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Mar 13 19:07:10 UTC 2024
    - 16.5K bytes
    - Viewed (0)
Back to top