[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-12-06 Thread Ronald Oussoren
Ronald Oussoren added the comment: The relevant API on macOS is [f]copyfile(3) which is at the POSIX layer. The copyFile API linked to in msg357395 is a higher-level ObjC/Swift API. Using the copyfile(3) API has another advantage beyond this issue: This API can perform a clone action on APFS

[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-11-27 Thread Eryk Sun
Eryk Sun added the comment: > copystat() and copymode() should be able to copy the same > metadata/security-bits/etc as CopyFileExW. Regarding metadata, CopyFileExW copies the basic file info (i.e. FileAttributes, LastAccessTime, LastWriteTime, and ChangeTime). This metadata can be copied

[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-11-27 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: If we use CopyFileExW in copy2(), then also copystat() and copymode() should be able to copy the same metadata/security-bits/etc as CopyFileExW. I don't know which Windows APIs should be used though. I sort of agree with Steven that CopyFileExW could be u

[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-11-25 Thread Steve Dower
Steve Dower added the comment: As a general statement (I haven't taken the time yet to understand all the intricacies of this particular issue), I would prefer to see CopyFile used everywhere on Windows for the performance and reliability benefits. Perfect POSIX emulation here doesn't seem h

[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-11-24 Thread Eryk Sun
Change by Eryk Sun : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-11-24 Thread Eryk Sun
Eryk Sun added the comment: In Windows, using CopyFileExW and CreateDirectoryExW (with a template directory, for copytree) doesn't agree with how shutil implements copying with separate copyfile and copymode/copystat functions. We'd have to extend copyfile() to support alternate data streams

[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-11-24 Thread Gregg Tavares
New submission from Gregg Tavares : MacOS have extended file attributes. Windows has both extended file attributes and alternate streams. In both OSes copy/cp and of course the Finder and Windows Explorer copy all this data. Python copy2 does not. On Windows it seems like CopyFileW needs to