Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. 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)
  2. pkg/volume/util/hostutil/hostutil_test.go

    	// 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")
    	return testSocketFile, socketCreateError
    }
    
    func TestGetFileType(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 01 16:02:07 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  3. src/syscall/exec_libc.go

    		}
    		err1 = setgid(uintptr(cred.Gid))
    		if err1 != 0 {
    			goto childerror
    		}
    		err1 = setuid(uintptr(cred.Uid))
    		if err1 != 0 {
    			goto childerror
    		}
    	}
    
    	// Chdir
    	if dir != nil {
    		err1 = chdir(uintptr(unsafe.Pointer(dir)))
    		if err1 != 0 {
    			goto childerror
    		}
    	}
    
    	// Pass 1: look for fd[i] < i and move those up above len(fd)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 29 18:51:35 UTC 2023
    - 8.2K bytes
    - Viewed (0)
  4. test/fixedbugs/bug369.go

    // Test that compiling with optimization turned on produces faster code.
    
    package main
    
    import (
    	"fmt"
    	"io/ioutil"
    	"os"
    	"os/exec"
    	"path/filepath"
    )
    
    func main() {
    	err := os.Chdir(filepath.Join(".", "fixedbugs", "bug369.dir"))
    	check(err)
    
    	tmpDir, err := ioutil.TempDir("", "bug369")
    	check(err)
    	defer os.RemoveAll(tmpDir)
    
    	tmp := func(name string) string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  5. src/syscall/asm_solaris_amd64.s

    //
    
    TEXT ·sysvicall6(SB),NOSPLIT,$0
    	JMP	runtime·syscall_sysvicall6(SB)
    
    TEXT ·rawSysvicall6(SB),NOSPLIT,$0
    	JMP	runtime·syscall_rawsysvicall6(SB)
    
    TEXT ·chdir(SB),NOSPLIT,$0
    	JMP	runtime·syscall_chdir(SB)
    
    TEXT ·chroot1(SB),NOSPLIT,$0
    	JMP	runtime·syscall_chroot(SB)
    
    TEXT ·closeFD(SB),NOSPLIT,$0
    	JMP	runtime·syscall_close(SB)
    
    TEXT ·dup2child(SB),NOSPLIT,$0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 15 17:21:30 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  6. src/runtime/syscall_aix.go

    package runtime
    
    import "unsafe"
    
    // This file handles some syscalls from the syscall package
    // Especially, syscalls use during forkAndExecInChild which must not split the stack
    
    //go:cgo_import_dynamic libc_chdir chdir "libc.a/shr_64.o"
    //go:cgo_import_dynamic libc_chroot chroot "libc.a/shr_64.o"
    //go:cgo_import_dynamic libc_dup2 dup2 "libc.a/shr_64.o"
    //go:cgo_import_dynamic libc_execve execve "libc.a/shr_64.o"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 14 17:22:18 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/testlife/life_test.go

    	// declaring the same path.
    	modRoot := filepath.Join(GOPATH, "src", "cgolife")
    	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 cgolife\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.5K bytes
    - Viewed (0)
  8. src/os/path_windows_test.go

    	testMkdirAllAtRoot(t, volName)
    }
    
    func TestRemoveAllLongPathRelative(t *testing.T) {
    	// Test that RemoveAll doesn't hang with long relative paths.
    	// See go.dev/issue/36375.
    	tmp := t.TempDir()
    	chdir(t, tmp)
    	dir := filepath.Join(tmp, "foo", "bar", strings.Repeat("a", 150), strings.Repeat("b", 150))
    	err := os.MkdirAll(dir, 0755)
    	if err != nil {
    		t.Fatal(err)
    	}
    	err = os.RemoveAll("foo")
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 23 16:37:32 UTC 2024
    - 8K bytes
    - Viewed (0)
  9. src/cmd/go/internal/work/build_test.go

    					cfg.BuildContext.GOPATH = oldGopath
    					os.Chdir(cwd)
    					err := os.RemoveAll(tmpGopath)
    					if err != nil {
    						t.Error(err)
    					}
    				}()
    				root := filepath.Join(tmpGopath, "src", data.rootedAt)
    				err = os.MkdirAll(root, 0755)
    				if err != nil {
    					t.Fatal(err)
    				}
    				cfg.BuildContext.GOPATH = tmpGopath
    				os.Chdir(root)
    			}
    			computed, err := libname(data.args, data.pkgs)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 19:09:38 UTC 2023
    - 8.3K bytes
    - Viewed (0)
  10. pkg/bootstrap/config_test.go

    	t.Setenv(IstioMetaPrefix+"OWNER", inputOwner)
    	t.Setenv(IstioMetaPrefix+"WORKLOAD_NAME", inputWorkloadName)
    
    	dir, _ := os.Getwd()
    	defer os.Chdir(dir)
    	// prepare a pod label file
    	tempDir := t.TempDir()
    	os.Chdir(tempDir)
    	os.MkdirAll("./etc/istio/pod/", os.ModePerm)
    	os.WriteFile(constants.PodInfoLabelsPath, []byte(`istio-locality="region.zone.subzone"`), 0o600)
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Mar 28 20:38:02 UTC 2024
    - 9.1K bytes
    - Viewed (0)
Back to top