github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/pkg/specgen/winpath_windows.go (about)

     1  package specgen
     2  
     3  import (
     4  	"github.com/sirupsen/logrus"
     5  	"os"
     6  	"path/filepath"
     7  )
     8  
     9  func shouldResolveUnixWinVariant(path string) bool {
    10  	return true
    11  }
    12  
    13  func shouldResolveWinPaths() bool {
    14  	return true
    15  }
    16  
    17  func resolveRelativeOnWindows(path string) string {
    18  	ret, err := filepath.Abs(path)
    19  	if err != nil {
    20  		logrus.Debugf("problem resolving possible relative path %q: %s", path, err.Error())
    21  		return path
    22  	}
    23  
    24  	return ret
    25  }
    26  
    27  func winPathExists(path string) bool {
    28  	_, err := os.Stat(path)
    29  	return err == nil
    30  }