Why ant copy task modify the ownership of the files

Discussion in 'Java' started by david wolf, Jul 20, 2006.

  1. david wolf

    david wolf Guest

    I have a question about using ant copy task.

    In Linux environment, if some files' owner are somebody else, but say
    my userid is in the group owner of these files. If I copy files over
    these files, the owner of these files are not changed, i.e. the owner
    of these files are still somebody else.

    In ant, if I use copy task to overwrite these files owned by someone
    else (but I am in the group owner of the files), these files' ownership
    will be change to my userid .

    I am wondering why? Can somebody give me an explanation?
    david wolf, Jul 20, 2006
    #1
    1. Advertising

  2. david wolf

    Juha Laiho Guest

    "david wolf" <> said:
    >I have a question about using ant copy task.
    >
    >In Linux environment, if some files' owner are somebody else, but say
    >my userid is in the group owner of these files. If I copy files over
    >these files, the owner of these files are not changed, i.e. the owner
    >of these files are still somebody else.
    >
    >In ant, if I use copy task to overwrite these files owned by someone
    >else (but I am in the group owner of the files), these files' ownership
    >will be change to my userid .


    Looks like in the first case (where you already have a write access to
    the files themselves), the files are not removed at all, but just
    the contents of the files are replaced.

    In the second case (ant), it looks like the files are removed and recreated.

    You could confirm this with "ls -li" before and after copy in each case;
    the first number is an "i-node number", which identifies a file. I would
    expect the i-node number to remain unchanged in the first case, but
    change in the second (ant) case.

    There's one significant difference I see with these two ways in addition
    to the ownership/permissions changing or not changing. In the first way
    (replace file contents), it is possible to copy new versions of files
    into a directory where you don't have write permission (as long as you
    have write permission to the files). In the second (ant) way, I guess
    you have to have write permission to the target directory, regardless of
    file permissions.
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
    Juha Laiho, Jul 22, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor
    Replies:
    0
    Views:
    8,822
    Victor
    Sep 1, 2004
  2. Replies:
    6
    Views:
    30,237
    Diplomat
    Jan 12, 2011
  3. krabhi
    Replies:
    1
    Views:
    9,263
    Marco Meschieri
    Aug 9, 2006
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,756
    Smokey Grindel
    Dec 2, 2006
  5. teggy
    Replies:
    0
    Views:
    804
    teggy
    May 29, 2007
Loading...

Share This Page