github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/os/default/file-meta-data.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package dos
     4  
     5  import (
     6  	etime "../../earth-time"
     7  	"../../file"
     8  	"../../protocol"
     9  )
    10  
    11  // fileMetaData implement protocol.FilemetaData interface
    12  type fileMetaData struct {
    13  	uri            file.URI
    14  	size           uint64
    15  	creationTime   etime.Time
    16  	lastAccessTime etime.Time
    17  	lastWriteTime  etime.Time
    18  }
    19  
    20  func (md *fileMetaData) URI() protocol.FileURI   { return &md.uri }
    21  func (md *fileMetaData) Size() uint64            { return md.size }
    22  func (md *fileMetaData) Created() protocol.Time  { return md.creationTime }
    23  func (md *fileMetaData) Accessed() protocol.Time { return md.lastAccessTime }
    24  func (md *fileMetaData) Modified() protocol.Time { return md.lastWriteTime }
    25  func (md *fileMetaData) Hidden() bool            { return md.uri.Name()[0] == '.' }
    26  
    27  // fileDirectoryMetaData implement protocol.FilemetaData interface
    28  type fileDirectoryMetaData struct {
    29  	dirNum  uint
    30  	fileNum uint
    31  	fileMetaData
    32  }
    33  
    34  func (md *fileDirectoryMetaData) DirNum() uint  { return md.dirNum }
    35  func (md *fileDirectoryMetaData) FileNum() uint { return md.fileNum }