github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/cmn/cos/fs_unix.go (about)

     1  // Package cos provides common low-level types and utilities for all aistore projects
     2  /*
     3   * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
     4   */
     5  package cos
     6  
     7  import "syscall"
     8  
     9  type FS struct {
    10  	Fs     string
    11  	FsType string
    12  	FsID   FsID
    13  }
    14  
    15  func (fs *FS) String() string { return fs.Fs + "(" + fs.FsType + ")" }
    16  
    17  func (fs *FS) Equal(otherFs FS) bool {
    18  	if fs.Fs == "" || otherFs.Fs == "" || fs.FsType == "" || otherFs.FsType == "" {
    19  		return false
    20  	}
    21  	return fs.FsID == otherFs.FsID
    22  }
    23  
    24  // syscall to check that path exists (see bench/lstat)
    25  func Stat(path string) error {
    26  	var sys syscall.Stat_t
    27  	return syscall.Stat(path, &sys)
    28  }