Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Why ant copy task modify the ownership of the files

Thread view: 
david wolf - 20 Jul 2006 19:04 GMT
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?
Juha Laiho - 22 Jul 2006 10:12 GMT
"david wolf" <yihucd@gmail.com> said:
>I have a question about using ant copy task.
>
[quoted text clipped - 6 lines]
>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.
Signature

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)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.