func makeAbsolute(name string) string {
	absolutePath, err := filepath.Abs(name)
	if err == nil {
		if strings.HasPrefix(absolutePath, `\\?\UNC\`) || strings.HasPrefix(absolutePath, `\\?\`) {
			return absolutePath
		}
		if strings.HasPrefix(absolutePath, `\\`) {
			return strings.Replace(absolutePath, `\\`, `\\?\UNC\`, 1)
		}
		return absolutePath
	}
	return name
}
windows cannot handle long relative paths, so relative are converted to absolute paths by default
package filesystem
import (
	"os"
	"path/filepath"
	"time"
	"github.com/spf13/afero"
	"strings"
)
type OsFs struct {
	afero.Fs
}
func NewOsFs() afero.Fs {
	return &OsFs{}
}
func (OsFs) Name() string { return "OsFs" }
func (OsFs) Create(name string) (afero.File, error) {
	f, e := os.Create(makeAbsolute(name))
	if f == nil {
		return nil, e
	}
	return f, e
}
func (OsFs) Mkdir(name string, perm os.FileMode) error {
	return os.Mkdir(makeAbsolute(name), perm)
}
func (OsFs) MkdirAll(path string, perm os.FileMode) error {
	return os.MkdirAll(makeAbsolute(path), perm)
}
func (OsFs) Open(name string) (afero.File, error) {
	f, e := os.Open(makeAbsolute(name))
	if f == nil {
		return nil, e
	}
	return f, e
}
func (OsFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error) {
	f, e := os.OpenFile(makeAbsolute(name), flag, perm)
	if f == nil {
		return nil, e
	}
	return f, e
}
func (OsFs) Remove(name string) error {
	return os.Remove(makeAbsolute(name))
}
func (OsFs) RemoveAll(path string) error {
	return os.RemoveAll(makeAbsolute(path))
}
func (OsFs) Rename(oldname, newname string) error {
	return os.Rename(makeAbsolute(oldname), makeAbsolute(newname))
}
func (OsFs) Stat(name string) (os.FileInfo, error) {
	return os.Stat(makeAbsolute(name))
}
func (OsFs) Chmod(name string, mode os.FileMode) error {
	return os.Chmod(makeAbsolute(name), mode)
}
func (OsFs) Chtimes(name string, atime time.Time, mtime time.Time) error {
	return os.Chtimes(makeAbsolute(name), atime, mtime)
}