Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 29 of 29 for tmp_file1 (0.14 sec)

  1. internal/ioutil/ioutil_test.go

    	f, err := os.CreateTemp("", "")
    	if err != nil {
    		t.Errorf("Error creating tmp file: %v", err)
    	}
    	tmpFile := f.Name()
    	f.Close()
    	defer os.Remove(f.Name())
    	fi1, err := os.Stat(tmpFile)
    	if err != nil {
    		t.Fatalf("Error Stat(): %v", err)
    	}
    	fi2, err := os.Stat(tmpFile)
    	if err != nil {
    		t.Fatalf("Error Stat(): %v", err)
    	}
    	if !SameFile(fi1, fi2) {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 22 23:07:14 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  2. src/cmd/internal/obj/x86/obj6_test.go

    		t.Fatal(err)
    	}
    	defer os.RemoveAll(tmpdir)
    	tmpfile, err := os.Create(filepath.Join(tmpdir, "input.s"))
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer tmpfile.Close()
    	_, err = tmpfile.WriteString(s)
    	if err != nil {
    		t.Fatal(err)
    	}
    	cmd := testenv.Command(t,
    		testenv.GoToolPath(t), "tool", "asm", "-S", "-dynlink",
    		"-o", filepath.Join(tmpdir, "output.6"), tmpfile.Name())
    
    	cmd.Env = append(os.Environ(),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 15 20:21:30 UTC 2022
    - 4.5K bytes
    - Viewed (0)
  3. src/mime/multipart/formdata.go

    }
    
    // RemoveAll removes any temporary files associated with a [Form].
    func (f *Form) RemoveAll() error {
    	var err error
    	for _, fhs := range f.File {
    		for _, fh := range fhs {
    			if fh.tmpfile != "" {
    				e := os.Remove(fh.tmpfile)
    				if e != nil && !errors.Is(e, os.ErrNotExist) && err == nil {
    					err = e
    				}
    			}
    		}
    	}
    	return err
    }
    
    // A FileHeader describes a file part of a multipart request.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 16:12:35 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  4. pkg/kubelet/kubeletconfig/util/files/files.go

    	// an absolute path to os.Open, and we ensure similar behavior in utilfs.FakeFS for testing.
    	tmpPath = tmpFile.Name()
    
    	// write data
    	if _, err := tmpFile.Write(data); err != nil {
    		return tmpPath, err
    	}
    	// sync file, to ensure it's written in case a hard reset happens
    	return tmpPath, tmpFile.Sync()
    }
    
    // ReplaceFile replaces the contents of the file at `path` with `data` by writing to a tmp file in the same
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 13 01:02:46 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  5. src/os/tempfile_test.go

    		{sep + "tempfile_test" + sep + "*foo", true},
    		{"tempfile_test*foo" + sep, true},
    	}
    	for _, tt := range tests {
    		t.Run(tt.pattern, func(t *testing.T) {
    			tmpfile, err := CreateTemp(tmpDir, tt.pattern)
    			if tmpfile != nil {
    				defer tmpfile.Close()
    			}
    			if tt.wantErr {
    				if err == nil {
    					t.Errorf("CreateTemp(..., %#q) succeeded, expected error", tt.pattern)
    				}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jan 19 20:45:37 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  6. src/io/ioutil/tempfile_test.go

    		{sep + "ioutil_test" + sep + "*foo", true},
    		{"ioutil_test*foo" + sep, true},
    	}
    	for _, tt := range tests {
    		t.Run(tt.pattern, func(t *testing.T) {
    			tmpfile, err := TempFile(tmpDir, tt.pattern)
    			defer func() {
    				if tmpfile != nil {
    					tmpfile.Close()
    				}
    			}()
    			if tt.wantErr {
    				if err == nil {
    					t.Errorf("Expected an error for pattern %q", tt.pattern)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 18 00:47:29 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  7. src/cmd/internal/obj/x86/asm_test.go

    			out:  `0x0010\s00016\s\(.*\)\tMOVQ\t\$2,\sCX`,
    		},
    	}
    
    	for _, test := range testCases {
    		if err := os.WriteFile(tmpfile, []byte(test.code), 0644); err != nil {
    			t.Fatal(err)
    		}
    		cmd := testenv.Command(t, testenv.GoToolPath(t), "tool", "asm", "-S", "-o", tmpout, tmpfile)
    		cmd.Env = append(os.Environ(), "GOARCH=amd64", "GOOS=linux")
    		out, err := cmd.CombinedOutput()
    		if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jul 28 19:39:51 UTC 2023
    - 9.2K bytes
    - Viewed (0)
  8. hack/lib/protoc.sh

    function kube::protoc::format() {
      local package=${1}
    
      # Update boilerplate for the generated file.
      cat hack/boilerplate/boilerplate.generatego.txt "${package}/api.pb.go" > tmpfile && mv tmpfile "${package}/api.pb.go"
    
      # Run gofmt to clean up the generated code.
      kube::golang::setup_env
      gofmt -s -w "${package}/api.pb.go"
    }
    
    # Compares the contents of $1 and $2
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 20:53:13 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  9. src/os/example_test.go

    	}
    }
    
    func ExampleMkdirTemp() {
    	dir, err := os.MkdirTemp("", "example")
    	if err != nil {
    		log.Fatal(err)
    	}
    	defer os.RemoveAll(dir) // clean up
    
    	file := filepath.Join(dir, "tmpfile")
    	if err := os.WriteFile(file, []byte("content"), 0666); err != nil {
    		log.Fatal(err)
    	}
    }
    
    func ExampleMkdirTemp_suffix() {
    	logsDir, err := os.MkdirTemp("", "*-logs")
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 17:35:49 UTC 2024
    - 8.4K bytes
    - Viewed (0)
Back to top