From d35818293a6a9bfd5d5faf602350054f139359e5 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Tue, 17 Jan 2023 01:03:10 -0500 Subject: [PATCH] fix: stub out the FileSize command so lotus libraries can build on Windows --- storage/sealer/fsutil/filesize_unix.go | 3 +++ storage/sealer/fsutil/filesize_windows.go | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 storage/sealer/fsutil/filesize_windows.go diff --git a/storage/sealer/fsutil/filesize_unix.go b/storage/sealer/fsutil/filesize_unix.go index 9c7f04ace..3d80e0b8a 100644 --- a/storage/sealer/fsutil/filesize_unix.go +++ b/storage/sealer/fsutil/filesize_unix.go @@ -1,3 +1,6 @@ +//go:build !windows +// +build !windows + package fsutil import ( diff --git a/storage/sealer/fsutil/filesize_windows.go b/storage/sealer/fsutil/filesize_windows.go new file mode 100644 index 000000000..aeef50473 --- /dev/null +++ b/storage/sealer/fsutil/filesize_windows.go @@ -0,0 +1,16 @@ +package fsutil + +import ( + "fmt" +) + +type SizeInfo struct { + OnDisk int64 +} + +// FileSize returns bytes used by a file or directory on disk +// NOTE: We care about the allocated bytes, not file or directory size +// This is not currently supported on Windows, but at least other lotus can components can build on Windows now +func FileSize(path string) (SizeInfo, error) { + return SizeInfo{0}, fmt.Errorf("unsupported") +}