Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 149 for temp_file (0.35 sec)

  1. 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)
  2. src/os/writeto_linux_test.go

    	t.Helper()
    
    	hook := hookSendFile(t)
    
    	client, server := createSocketPair(t, proto)
    	tempFile, data := createTempFile(t, size)
    
    	return client, tempFile, server, data, hook
    }
    
    func hookSendFile(t *testing.T) *sendFileHook {
    	h := new(sendFileHook)
    	orig := poll.TestHookDidSendFile
    	t.Cleanup(func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 18:12:56 UTC 2024
    - 4K bytes
    - Viewed (0)
  3. test/fixedbugs/issue21317.go

    // column matching so instead match the output manually
    // by exec-ing
    
    package main
    
    import (
    	"fmt"
    	"io/ioutil"
    	"log"
    	"os"
    	"os/exec"
    	"strings"
    )
    
    func main() {
    	f, err := ioutil.TempFile("", "issue21317.go")
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Fprintf(f, `
    package main
    
    import "fmt"
    
    func main() {
            n, err := fmt.Println(1)
    }
    `)
    	f.Close()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  4. pkg/util/filesystem/filesystem.go

    	RemoveAll(path string) error
    	Remove(name string) error
    
    	// from "os"
    	ReadFile(filename string) ([]byte, error)
    	TempDir(dir, prefix string) (string, error)
    	TempFile(dir, prefix string) (File, error)
    	ReadDir(dirname string) ([]os.DirEntry, error)
    	Walk(root string, walkFn filepath.WalkFunc) error
    }
    
    // File is an interface that we can use to mock various filesystem operations typically
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 13 01:02:46 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  5. src/net/sendfile_test.go

    	)
    
    	defer wg.Wait()
    
    	ln := newLocalListener(b, "tcp")
    	defer ln.Close()
    
    	tempFile, err := os.CreateTemp(b.TempDir(), "test.txt")
    	if err != nil {
    		b.Fatalf("failed to create temp file: %v", err)
    	}
    	defer tempFile.Close()
    
    	fileName := tempFile.Name()
    
    	dataSize := b.N
    	wg.Add(1)
    	go func(f *os.File) {
    		defer wg.Done()
    
    		for i := 0; i < dataSize; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 18:12:56 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook_v1_test.go

    		err := func() error {
    			tempfile, err := ioutil.TempFile("", "")
    			if err != nil {
    				return err
    			}
    			p := tempfile.Name()
    			defer utiltesting.CloseAndRemove(t, tempfile)
    
    			tmpl, err := template.New("test").Parse(tt.configTmpl)
    			if err != nil {
    				return fmt.Errorf("failed to parse test template: %v", err)
    			}
    			if err := tmpl.Execute(tempfile, data); err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 43.2K bytes
    - Viewed (0)
  7. src/embed/embed.go

    //	var content embed.FS
    //
    // The difference is that ‘image/*’ embeds ‘image/.tempfile’ while ‘image’ does not.
    // Neither embeds ‘image/dir/.tempfile’.
    //
    // If a pattern begins with the prefix ‘all:’, then the rule for walking directories is changed
    // to include those files beginning with ‘.’ or ‘_’. For example, ‘all:image’ embeds
    // both ‘image/.tempfile’ and ‘image/dir/.tempfile’.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:42:51 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  8. test/fixedbugs/issue22662b.go

    	{"/*line :10:4*/", "filename:10:4"},
    	{"/*line foo.go:10*/", "foo.go:10:"},
    	{"/*line foo.go:10:4*/", "foo.go:10:4:"},
    	{"/*line foo.go:10:4*/\n", "foo.go:11:1:"},
    }
    
    func main() {
    	f, err := ioutil.TempFile("", "issue22662b.go")
    	if err != nil {
    		log.Fatal(err)
    	}
    	f.Close()
    	defer os.Remove(f.Name())
    
    	for _, test := range tests {
    		if err := ioutil.WriteFile(f.Name(), []byte(test.src), 0660); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  9. test/fixedbugs/issue9355.go

    import (
    	"fmt"
    	"io/ioutil"
    	"os"
    	"os/exec"
    	"path/filepath"
    	"regexp"
    )
    
    func main() {
    	err := os.Chdir(filepath.Join("fixedbugs", "issue9355.dir"))
    	check(err)
    
    	f, err := ioutil.TempFile("", "issue9355-*.o")
    	if err != nil {
    		fmt.Println(err)
    		os.Exit(1)
    	}
    	f.Close()
    
    	out := run("go", "tool", "compile", "-p=p", "-o", f.Name(), "-S", "a.go")
    	os.Remove(f.Name())
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  10. src/cmd/internal/obj/ppc64/asm_test.go

    	}
    
    	for _, pgm := range pgms {
    		tmpfile := filepath.Join(dir, "x.s")
    		err = os.WriteFile(tmpfile, pgm.text, 0644)
    		if err != nil {
    			t.Fatalf("can't write output: %v\n", err)
    		}
    		cmd := testenv.Command(t, testenv.GoToolPath(t), "tool", "asm", "-S", "-o", filepath.Join(dir, "test.o"), tmpfile)
    		cmd.Env = append(os.Environ(), "GOOS=linux", "GOARCH=ppc64le")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 09 22:14:57 UTC 2024
    - 17.3K bytes
    - Viewed (0)
Back to top