1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

COPYing attributes

Discussion in 'Support' started by Steve Fabian, Aug 1, 2010.

  1. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    It appears that the Hidden attribute of directories copied using COPY /H is
    not copied. The H attribute of files is properly copied.
    --
    Steve
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,860
    Likes Received:
    83
    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
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    ---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
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,860
    Likes Received:
    83
    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.


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

    Rex Conn
    JP Software
     

Share This Page