This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: shutil.copystat does not copy the "hidden" flag on windows
Type: behavior Stage:
Components: Windows Versions: Python 2.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: tarek Nosy List: loewis, tarek, throbi
Priority: normal Keywords:

Created on 2009-02-06 13:18 by throbi, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
copyHiddenFile.zip throbi, 2009-02-06 13:18 just unzip and run copyhiddenfile.py
Messages (2)
msg81263 - (view) Author: Horváth István Róbert (throbi) Date: 2009-02-06 13:18
Hi!

While copying hidden files on windows, the hidden flag is lost
(surprisingly the read-only flag is copied).

Is this a bug or a feature? The documentation only says that flags are
also copied by shutil.copystat, but no details.

See the attached file for an example.

Cheers,
Robert
msg81322 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-02-07 00:04
It's neither a bug nor a feature. It's simply not possible to copy the
hidden flag (or system flag, for that matter), since there is no API for
doing so. copystat only copies Unix attributes.

If you were to copy the hidden flag, you would also have to copy the
read-only flag, the access control list, and possible alternative file
streams. You better use the CopyFile API function of Windows for that.
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49418
2010-04-19 22:35:12tareksetstatus: open -> closed
assignee: tarek

resolution: wont fix
nosy: + tarek
2009-02-07 00:04:35loewissetnosy: + loewis
messages: + msg81322
2009-02-06 13:18:37throbicreate