Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 126 for chdir (0.07 sec)

  1. src/os/removeall_test.go

    	}
    	defer RemoveAll(tempDir)
    
    	err = Chdir(tempDir)
    	if err != nil {
    		t.Fatalf("Could not chdir to tempdir: %s", err)
    	}
    
    	err = RemoveAll(".")
    	if err == nil {
    		t.Errorf("RemoveAll succeed to remove .")
    	}
    
    	err = Chdir(prevDir)
    	if err != nil {
    		t.Fatalf("Could not chdir %s: %s", prevDir, err)
    	}
    }
    
    func TestRemoveAllDotDot(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:29 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  2. src/path/filepath/path_test.go

    		}
    		return err
    	}
    	return nil
    }
    
    // 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("getwd %s: %v", dir, err)
    	}
    	if err := os.Chdir(dir); err != nil {
    		t.Fatalf("chdir %s: %v", dir, err)
    	}
    
    	t.Cleanup(func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:38:19 UTC 2024
    - 47.1K bytes
    - Viewed (0)
  3. src/cmd/pack/pack_test.go

    	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)
  4. src/os/os_windows_test.go

    type syscallDescriptor = syscall.Handle
    
    // 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() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 41.8K bytes
    - Viewed (0)
  5. scripts/docs.py

            shutil.rmtree(dist_path, ignore_errors=True)
        current_dir = os.getcwd()
        os.chdir(lang_path)
        shutil.rmtree(build_site_dist_path, ignore_errors=True)
        subprocess.run(["mkdocs", "build", "--site-dir", build_site_dist_path], check=True)
        shutil.copytree(build_site_dist_path, dist_path, dirs_exist_ok=True)
        os.chdir(current_dir)
        typer.secho(f"Successfully built docs for: {lang}", color=typer.colors.GREEN)
    
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon Jan 22 19:26:14 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. src/os/file_plan9.go

    		dir = "/tmp"
    	}
    	return dir
    }
    
    // Chdir changes the current working directory to the file,
    // which must be a directory.
    // If there is an error, it will be of type *PathError.
    func (f *File) Chdir() error {
    	if err := f.incref("chdir"); err != nil {
    		return err
    	}
    	defer f.decref()
    	if e := syscall.Fchdir(f.fd); e != nil {
    		return &PathError{Op: "chdir", Path: f.name, Err: e}
    	}
    	return nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 30 15:35:30 UTC 2024
    - 16K bytes
    - Viewed (0)
  10. src/cmd/dist/util.go

    // real is defined as what xgetwd returns in that directory.
    func xrealwd(path string) string {
    	old := xgetwd()
    	if err := os.Chdir(path); err != nil {
    		fatalf("chdir %s: %v", path, err)
    	}
    	real := xgetwd()
    	if err := os.Chdir(old); err != nil {
    		fatalf("chdir %s: %v", old, err)
    	}
    	return real
    }
    
    // isdir reports whether p names an existing directory.
    func isdir(p string) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 23 17:50:29 UTC 2023
    - 11.2K bytes
    - Viewed (0)
Back to top