- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 98 for O_CREATE (0.32 sec)
-
src/runtime/testdata/testsuid/main.go
"log" "os" ) func main() { if os.Geteuid() == os.Getuid() { os.Exit(99) } fmt.Fprintf(os.Stdout, "GOTRACEBACK=%s\n", os.Getenv("GOTRACEBACK")) f, err := os.OpenFile(os.Getenv("TEST_OUTPUT"), os.O_CREATE|os.O_RDWR, 0600) if err != nil { log.Fatalf("os.Open failed: %s", err) } defer f.Close() fmt.Fprintf(os.Stderr, "hello\n")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 06 18:49:01 UTC 2023 - 534 bytes - Viewed (0) -
src/runtime/testdata/testfds/main.go
// license that can be found in the LICENSE file. package main import ( "fmt" "io" "log" "os" ) func main() { f, err := os.OpenFile(os.Getenv("TEST_OUTPUT"), os.O_CREATE|os.O_RDWR, 0600) if err != nil { log.Fatalf("os.Open failed: %s", err) } defer f.Close() b, err := io.ReadAll(os.Stdin) if err != nil { log.Fatalf("io.ReadAll(os.Stdin) failed: %s", err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jul 25 16:33:33 UTC 2023 - 642 bytes - Viewed (0) -
src/os/exec/lp_unix_test.go
import ( "os" "os/exec" "testing" ) func TestLookPathUnixEmptyPath(t *testing.T) { // Not parallel: uses Chdir and Setenv. tmp := t.TempDir() chdir(t, tmp) f, err := os.OpenFile("exec_me", os.O_CREATE|os.O_EXCL, 0700) if err != nil { t.Fatal("OpenFile failed: ", err) } err = f.Close() if err != nil { t.Fatal("Close failed: ", err) } t.Setenv("PATH", "")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Sep 13 18:19:21 UTC 2023 - 762 bytes - Viewed (0) -
cmd/kubeadm/app/phases/upgrade/postupgrade_test.go
certFile, err := os.OpenFile(certPath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0666) if err != nil { t.Fatalf("Failed to create cert file %s: %v", certPath, err) } certFile.Close() keyPath := filepath.Join(tmpdir, constants.APIServerKeyName) keyFile, err := os.OpenFile(keyPath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0666) if err != nil {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Jan 15 11:40:04 UTC 2024 - 7.2K bytes - Viewed (0) -
src/cmd/go/testdata/script/test_fuzz_mutator.txt
logFile *os.File ) func TestMain(m *testing.M) { flag.Parse() var err error logFile, err = os.OpenFile(*logPath, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0666) if os.IsExist(err) { *logPath += ".worker" logFile, err = os.OpenFile(*logPath, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0666) } if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } os.Exit(m.Run()) } func FuzzA(f *testing.F) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 16 16:53:11 UTC 2023 - 3.7K bytes - Viewed (0) -
internal/ioutil/append-file_nix.go
package ioutil import ( "io" "os" ) // AppendFile - appends the file "src" to the file "dst" func AppendFile(dst string, src string, osync bool) error { flags := os.O_WRONLY | os.O_APPEND | os.O_CREATE if osync { flags |= os.O_SYNC } appendFile, err := os.OpenFile(dst, flags, 0o666) if err != nil { return err } defer appendFile.Close() srcFile, err := os.Open(src) if err != nil {
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Sun Jan 02 17:15:06 UTC 2022 - 1.3K bytes - Viewed (0) -
src/cmd/go/internal/lockedfile/lockedfile.go
func Open(name string) (*File, error) { return OpenFile(name, os.O_RDONLY, 0) } // Create is like os.Create, but returns a write-locked file. func Create(name string) (*File, error) { return OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666) } // Edit creates the named file with mode 0666 (before umask), // but does not truncate existing contents. // // If Edit succeeds, methods on the returned File can be used for I/O.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 20 18:41:18 UTC 2020 - 5.1K bytes - Viewed (0) -
src/cmd/pack/pack.go
switch op { case 'p': ar = openArchive(os.Args[2], os.O_RDONLY, os.Args[3:]) ar.scan(ar.printContents) case 'r': ar = openArchive(os.Args[2], os.O_RDWR|os.O_CREATE, os.Args[3:]) ar.addFiles() case 'c': ar = openArchive(os.Args[2], os.O_RDWR|os.O_TRUNC|os.O_CREATE, os.Args[3:]) ar.addPkgdef() ar.addFiles() case 't': ar = openArchive(os.Args[2], os.O_RDONLY, os.Args[3:]) ar.scan(ar.tableOfContents) case 'x':
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 14 19:41:17 UTC 2024 - 8.2K bytes - Viewed (0) -
src/testing/run_example_wasm.go
return } func createTempFile(exampleName string) *os.File { for i := 0; ; i++ { name := fmt.Sprintf("%s/go-example-stdout-%s-%d.txt", os.TempDir(), exampleName, i) f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) if err != nil { if os.IsExist(err) { continue } fmt.Fprintf(os.Stderr, "testing: open temp file: %v\n", err) os.Exit(1) } return f }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 11 20:56:32 UTC 2023 - 1.8K bytes - Viewed (0) -
src/cmd/vendor/github.com/google/pprof/internal/driver/tempfile.go
func newTempFile(dir, prefix, suffix string) (*os.File, error) { for index := 1; index < 10000; index++ { switch f, err := os.OpenFile(filepath.Join(dir, fmt.Sprintf("%s%03d%s", prefix, index, suffix)), os.O_RDWR|os.O_CREATE|os.O_EXCL, 0666); { case err == nil: return f, nil case !os.IsExist(err): return nil, err } } // Give up return nil, fmt.Errorf("could not create file of the form %s%03d%s", prefix, 1, suffix)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 22 23:33:06 UTC 2020 - 1.7K bytes - Viewed (0)