From 37587d520ee3a32f7e396edc29a3a21bd5b3efc2 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Tue, 5 Mar 2024 08:40:12 -0800 Subject: [PATCH] Preserve Local cp_file metadata. Fixes #1524 --- fsspec/implementations/local.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fsspec/implementations/local.py b/fsspec/implementations/local.py index 17f96c1b8..a6fa7691d 100644 --- a/fsspec/implementations/local.py +++ b/fsspec/implementations/local.py @@ -122,6 +122,7 @@ def cp_file(self, path1, path2, **kwargs): self.makedirs(self._parent(path2), exist_ok=True) if self.isfile(path1): shutil.copyfile(path1, path2) + shutil.copystat(path1, path2) elif self.isdir(path1): self.mkdirs(path2, exist_ok=True) else: