Recursively copy Go virtual file systems, such as gobindata, vfsgen, and http.FileSystem.
Go to file
AJ ONeal aee651a375 add symlink support 2020-10-23 14:29:09 -06:00
fixtures/src add virtual filesystem support 2020-10-23 13:55:37 -06:00
README.md add symlink support 2020-10-23 14:29:09 -06:00
copy.go add symlink support 2020-10-23 14:29:09 -06:00
copy_test.go add virtual filesystem support 2020-10-23 13:55:37 -06:00
go.mod initial commit with native filesystem 2020-10-23 13:53:09 -06:00
options.go initial commit with native filesystem 2020-10-23 13:53:09 -06:00
vfs.go add symlink support 2020-10-23 14:29:09 -06:00

README.md

vfscopy

Copy a Virtual FileSystem, such as http.FileSystem, recursively to a native file system destination.

httpfs := http.Dir("/tmp/public/")
vfs := vfscopy.NewVFS(httpfs)

if err := Copy(vfs, ".", "/tmp/dst/"); nil != err {
    fmt.Fprintf(os.Stderr, "couldn't copy vfs: %v\n", err)
}