COPYing attributes

rconn

Administrator
Staff member
May 14, 2008
12,344
149
> It appears that the Hidden attribute of directories copied using COPY
> /H is not copied. The H attribute of files is properly copied.

WAD.

There was a lot of discussion about this 15+ years ago, and it was
eventually decided that not copying the attribute bits for directories made
the most sense in most cases. (Which would seem to be corroborated by your
experience, since you only just now discovered this after many years of
use!)

Rex Conn
JP Software
 
May 20, 2008
3,515
4
Elkridge, MD, USA
---Quote---
|| It appears that the Hidden attribute of directories copied using COPY
|| /H is not copied. The H attribute of files is properly copied.
| ---End Quote---
| WAD.
|
| There was a lot of discussion about this 15+ years ago, and it was
| eventually decided that not copying the attribute bits for directories
made
| the most sense in most cases. (Which would seem to be corroborated by
your
| experience, since you only just now discovered this after many years of
| use!)

No, I just don't often copy full trees which include hidden
directories, and I always attributed the issue to cockpit error, not
to a design feature in conflict with documentation:

"/K (Keep read-only attribute) To maintain compatibility with CMD.EXE,
COPY normally maintains the hidden and system attributes, sets the
archive attribute, and removes the read-only attribute on the target
file. /K tells COPY to also maintain the read-only attribute on the
destination file...."

There is no mention that the phrase relating to hidden and system
attributes applies only to files, not directories!

In any event, I now suggest adding a suboption either to the /H
or the /K option to copy the hidden and system attributes of
directories as well as files.
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
> "/K (Keep read-only attribute) To maintain compatibility with CMD.EXE,
> COPY normally maintains the hidden and system attributes, sets the
> archive attribute, and removes the read-only attribute on the
> target
> file. /K tells COPY to also maintain the read-only attribute on the
> destination file...."
>
> There is no mention that the phrase relating to hidden and system
> attributes applies only to files, not directories!

I think that "on the target file" clearly indicates that it's referring to
files, not directories. And since CMD doesn't copy directories, the phrase
could only apply to files.


> In any event, I now suggest adding a suboption either to the /H
> or the /K option to copy the hidden and system attributes of
> directories as well as files.

COPY isn't a very good choice if what you want to do is duplicate a file
system.

Rex Conn
JP Software
 
Similar threads
Thread starter Title Forum Replies Date
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
D When copying/moving, appending " (2)" to filename when the target file already exist. Support 7
redwdc Copying files with spaces, commas, etc. Support 5
P Copying files in subdirectories Support 9
S iftp copying pgp files from ftp is not working Support 11
P Copying descript.ion file fails Support 8
JohnQSmith Fixed Copying with regex (several issues) Support 7
rps Documentation Help file revision - Copying hidden DESCRIPT.ION files Support 19
S Copying descriptions in DESCRIPT.ION Support 3
Joe Caverly Copying text of MSGBOX Support 0
M Copying files (NOT file contents) to clipboard from TCC Support 17
P Copying descriptions Support 4
samintz How to? exclude a subdirectory when copying Support 2
Charles Dye Difficulty copying DESCRIPT.ION files Support 1
Roedy copying files to DVD or CD Support 3
K Copying and mouse Support 0
CWBillow Windows 7 copying and Take Command Support 5
A GPF when copying large amount of data on busy USB Drive Support 3
p.f.moore Copying Take Command installed folder Support 19
Kachupp Colour Attributes Support 2
Alpengreis How to? Copy DIRs with attributes ... Support 4
mfarah Fixed TCC seems to dislike the P and U attributes. Support 2
vefatica del, attributes, et c. Support 0
R Delete command sets directory attributes to hidden & system Support 46
mscheuner How to access XML *attributes* using XPath Support 3

Similar threads