...

Source file src/sigs.k8s.io/kustomize/kyaml/filesys/fileondisk.go

Documentation: sigs.k8s.io/kustomize/kyaml/filesys

     1  // Copyright 2019 The Kubernetes Authors.
     2  // SPDX-License-Identifier: Apache-2.0
     3  
     4  package filesys
     5  
     6  import (
     7  	"os"
     8  )
     9  
    10  var _ File = &fileOnDisk{}
    11  
    12  // fileOnDisk implements File using the local filesystem.
    13  type fileOnDisk struct {
    14  	file *os.File
    15  }
    16  
    17  // Close closes a file.
    18  func (f *fileOnDisk) Close() error { return f.file.Close() }
    19  
    20  // Read reads a file's content.
    21  func (f *fileOnDisk) Read(p []byte) (n int, err error) { return f.file.Read(p) }
    22  
    23  // Write writes bytes to a file
    24  func (f *fileOnDisk) Write(p []byte) (n int, err error) { return f.file.Write(p) }
    25  
    26  // Stat returns an interface which has all the information regarding the file.
    27  func (f *fileOnDisk) Stat() (os.FileInfo, error) { return f.file.Stat() }
    28  

View as plain text