package polyfill

import (
	
	

	
)
Polyfill is a helper that implements all missing method from billy.Filesystem.
New creates a new filesystem wrapping up 'fs' the intercepts all the calls made and errors if fs doesn't implement any of the billy interfaces.
func ( billy.Basic) billy.Filesystem {
	if ,  := .(billy.Filesystem);  {
		return 
	}

	 := &Polyfill{Basic: }

	_, .c.tempfile = .Basic.(billy.TempFile)
	_, .c.dir = .Basic.(billy.Dir)
	_, .c.symlink = .Basic.(billy.Symlink)
	_, .c.chroot = .Basic.(billy.Chroot)
	return 
}

func ( *Polyfill) (,  string) (billy.File, error) {
	if !.c.tempfile {
		return nil, billy.ErrNotSupported
	}

	return .Basic.(billy.TempFile).TempFile(, )
}

func ( *Polyfill) ( string) ([]os.FileInfo, error) {
	if !.c.dir {
		return nil, billy.ErrNotSupported
	}

	return .Basic.(billy.Dir).ReadDir()
}

func ( *Polyfill) ( string,  os.FileMode) error {
	if !.c.dir {
		return billy.ErrNotSupported
	}

	return .Basic.(billy.Dir).MkdirAll(, )
}

func ( *Polyfill) (,  string) error {
	if !.c.symlink {
		return billy.ErrNotSupported
	}

	return .Basic.(billy.Symlink).Symlink(, )
}

func ( *Polyfill) ( string) (string, error) {
	if !.c.symlink {
		return "", billy.ErrNotSupported
	}

	return .Basic.(billy.Symlink).Readlink()
}

func ( *Polyfill) ( string) (os.FileInfo, error) {
	if !.c.symlink {
		return nil, billy.ErrNotSupported
	}

	return .Basic.(billy.Symlink).Lstat()
}

func ( *Polyfill) ( string) (billy.Filesystem, error) {
	if !.c.chroot {
		return nil, billy.ErrNotSupported
	}

	return .Basic.(billy.Chroot).Chroot()
}

func ( *Polyfill) () string {
	if !.c.chroot {
		return string(filepath.Separator)
	}

	return .Basic.(billy.Chroot).Root()
}

func ( *Polyfill) () billy.Basic {
	return .Basic
}
Capabilities implements the Capable interface.