Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Why ant copy task modify the ownership of the files

Reply
Thread Tools

Why ant copy task modify the ownership of the files

 
 
david wolf
Guest
Posts: n/a
 
      07-20-2006
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?

 
Reply With Quote
 
 
 
 
Juha Laiho
Guest
Posts: n/a
 
      07-22-2006
"david wolf" <(E-Mail Removed)> 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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ant COPY task, want to copy the directory itself, not just its contents! dxd@ptc.com Java 6 01-12-2011 12:30 PM
Ant Copy Task and Hidden Files russ.vanderwerff@sencore.com Java 6 09-27-2007 01:47 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Maven using ANT plugin for SCP task : Embedded error: Could not create task or type of type: scp. krabhi Java 1 08-09-2006 04:19 PM
Re: Problem in ant replace task and replaceregexp task to update xml Victor Java 0 09-01-2004 03:58 AM



Advertisments