Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 194 for chtimes (0.21 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. src/os/file_plan9.go

    	}
    	return nil
    }
    
    // Chtimes changes the access and modification times of the named
    // file, similar to the Unix utime() or utimes() functions.
    // A zero time.Time value will leave the corresponding file time unchanged.
    //
    // The underlying filesystem may truncate or round the values to a
    // less precise time unit.
    // If there is an error, it will be of type *PathError.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 30 15:35:30 UTC 2024
    - 16K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. src/cmd/go/internal/cache/cache.go

    // nearly all of the mtime updates that would otherwise happen,
    // while still keeping the mtimes useful for cache trimming.
    func (c *DiskCache) used(file string) {
    	info, err := os.Stat(file)
    	if err == nil && c.now().Sub(info.ModTime()) < mtimeInterval {
    		return
    	}
    	os.Chtimes(file, c.now(), c.now())
    }
    
    func (c *DiskCache) Close() error { return c.Trim() }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Mar 09 14:19:39 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  10. src/os/os_test.go

    func TestChtimesToUnixZero(t *testing.T) {
    	file := newFile("chtimes-to-unix-zero", t)
    	fn := file.Name()
    	defer Remove(fn)
    	if _, err := file.Write([]byte("hi")); err != nil {
    		t.Fatal(err)
    	}
    	if err := file.Close(); err != nil {
    		t.Fatal(err)
    	}
    
    	unixZero := time.Unix(0, 0)
    	if err := Chtimes(fn, unixZero, unixZero); err != nil {
    		t.Fatalf("Chtimes failed: %v", err)
    	}
    
    	st, err := Stat(fn)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 83.1K bytes
    - Viewed (0)
Back to top