Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for chtimes (0.2 sec)

  1. pkg/kubelet/container/os.go

    // Hostname will call os.Hostname to return the hostname.
    func (RealOS) Hostname() (name string, err error) {
    	return os.Hostname()
    }
    
    // Chtimes will call os.Chtimes to change the atime and mtime of the path
    func (RealOS) Chtimes(path string, atime time.Time, mtime time.Time) error {
    	return os.Chtimes(path, atime, mtime)
    }
    
    // Pipe will call os.Pipe to return a connected pair of pipe.
    func (RealOS) Pipe() (r *os.File, w *os.File, err error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jul 30 03:35:26 UTC 2022
    - 3.7K bytes
    - Viewed (0)
  2. pkg/util/filesystem/defaultfs.go

    	// If existence of path not known, attempt to create it.
    	if err := os.MkdirAll(path, perm); err != nil {
    		return err
    	}
    	return nil
    }
    
    // Chtimes via os.Chtimes
    func (fs *DefaultFs) Chtimes(name string, atime time.Time, mtime time.Time) error {
    	return os.Chtimes(fs.prefix(name), atime, mtime)
    }
    
    // RemoveAll via os.RemoveAll
    func (fs *DefaultFs) RemoveAll(path string) error {
    	return os.RemoveAll(fs.prefix(path))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 03 07:38:14 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  3. pkg/kubelet/container/testing/os.go

    	return nil
    }
    
    // Hostname is a fake call that returns nil.
    func (f *FakeOS) Hostname() (name string, err error) {
    	return f.HostName, nil
    }
    
    // Chtimes is a fake call that returns nil.
    func (*FakeOS) Chtimes(path string, atime time.Time, mtime time.Time) error {
    	return nil
    }
    
    // Pipe is a fake call that returns nil.
    func (*FakeOS) Pipe() (r *os.File, w *os.File, err error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Feb 07 13:37:31 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  4. src/os/file_posix.go

    // If there is an error, it will be of type [*PathError].
    func Chtimes(name string, atime time.Time, mtime time.Time) error {
    	var utimes [2]syscall.Timespec
    	set := func(i int, t time.Time) {
    		if t.IsZero() {
    			utimes[i] = syscall.Timespec{Sec: _UTIME_OMIT, Nsec: _UTIME_OMIT}
    		} else {
    			utimes[i] = syscall.NsecToTimespec(t.UnixNano())
    		}
    	}
    	set(0, atime)
    	set(1, mtime)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:12 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  5. pkg/util/filesystem/filesystem.go

    type Filesystem interface {
    	// from "os"
    	Stat(name string) (os.FileInfo, error)
    	Create(name string) (File, error)
    	Rename(oldpath, newpath string) error
    	MkdirAll(path string, perm os.FileMode) error
    	Chtimes(name string, atime time.Time, mtime time.Time) error
    	RemoveAll(path string) error
    	Remove(name string) error
    
    	// from "os"
    	ReadFile(filename string) ([]byte, error)
    	TempDir(dir, prefix string) (string, error)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 13 01:02:46 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  6. src/cmd/gofmt/gofmt_unix_test.go

    	if err := os.WriteFile(filepath.Join(fn), []byte("  package main"), 0o400); err != nil {
    		t.Fatal(err)
    	}
    
    	// Set mtime of the file in the past.
    	past := time.Now().Add(-time.Hour)
    	if err := os.Chtimes(fn, past, past); err != nil {
    		t.Fatal(err)
    	}
    
    	info, err := os.Stat(fn)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	defer func() { *write = false }()
    	*write = true
    
    	initParserMode()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 18 12:52:14 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  7. src/cmd/go/testdata/script/test_cache_inputs.txt

    # changes to the external inputs to the test.
    
    [short] skip
    [GODEBUG:gocacheverify=1] skip
    
    # We're testing cache behavior, so start with a clean GOCACHE.
    env GOCACHE=$WORK/cache
    
    # Build a helper binary to invoke os.Chtimes.
    go build -o mkold$GOEXE mkold.go
    
    # Make test input files appear to be a minute old.
    exec ./mkold$GOEXE 1m testcache/file.txt
    exec ./mkold$GOEXE 1m testcache/script.sh
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Mar 09 22:23:53 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  8. src/os/example_test.go

    		log.Fatal(err)
    	}
    }
    
    func ExampleChtimes() {
    	mtime := time.Date(2006, time.February, 1, 3, 4, 5, 0, time.UTC)
    	atime := time.Date(2007, time.March, 2, 4, 5, 6, 0, time.UTC)
    	if err := os.Chtimes("some-filename", atime, mtime); err != nil {
    		log.Fatal(err)
    	}
    }
    
    func ExampleFileMode() {
    	fi, err := os.Lstat("some-filename")
    	if err != nil {
    		log.Fatal(err)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 17:35:49 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  9. test/index.go

    		}
    	})
    
    	fmt.Fprintln(b, "}")
    	b.Flush()
    }
    
    func forall(choices [][]string, f func([]string)) {
    	x := make([]string, len(choices))
    
    	var recurse func(d int)
    	recurse = func(d int) {
    		if d >= len(choices) {
    			f(x)
    			return
    		}
    		for _, x[d] = range choices[d] {
    			recurse(d + 1)
    		}
    	}
    	recurse(0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Sep 08 17:28:20 UTC 2019
    - 6.4K bytes
    - Viewed (0)
  10. pkg/test/loadbalancersim/timeseries/instance.go

    }
    
    type times []time.Time
    
    func (t times) copy() times {
    	out := make(times, 0, len(t))
    	out = append(out, t...)
    	return out
    }
    
    func (t times) asDurationSinceEpoch(epoch time.Time) []time.Duration {
    	out := make([]time.Duration, 0, len(t))
    	for _, tm := range t {
    		out = append(out, tm.Sub(epoch))
    	}
    	return out
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 1.8K bytes
    - Viewed (0)
Back to top