Bug 8663 - Copy of a read only file is read only too
Summary: Copy of a read only file is read only too
Status: RESOLVED DUPLICATE of bug 4210
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Erich Gamma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-29 07:23 EST by Birgit Guder CLA
Modified: 2002-05-11 15:12 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Birgit Guder CLA 2002-01-29 07:23:50 EST
When copying a file that is read only, the newly created file is marked as read only too. I would have 
expected it to be writeable. 

In addition, if a java file is copied through the Java Package 
Browser, the package information cannot be updated, resulting in an incorrect java file.
Comment 1 DJ Houghton CLA 2002-01-29 08:34:52 EST
Behaviour in Win98 and Linux is that the destination file is also read-only.

Is there a particular use case or filesystem that you are using where you do not
see the read-only attribute copied?
Comment 2 John Arthorne CLA 2002-01-29 10:24:44 EST
This seems to be the desired behaviour.  Copying directly in Windows 2000/NT has 
the same effect.  See also:

bug 6058 - copying IFolder loses read-only flag setting

which reports the opposite behaviour as a defect.
Comment 3 DJ Houghton CLA 2002-01-30 09:18:46 EST
Moving to JDT/UI for comments on second problem. (moving a Java file causes the 
package information to be incorrect)
Comment 4 David Wegener CLA 2002-02-04 12:10:17 EST
I agree with Birgit, at least when performing a copy in the JDT UI.  One of the 
advantage of using the copy (rename and move also) features in the Java 
perspective is the refactoring that takes place to insure that the correct 
package, class name, and constructors are maintained.  Our VCM is clearcase and 
we develop right on top of the 'repository'.  This means that the only way to 
make a file writable is to check it out.  It is not desirable to be forced to 
checkout a file simply to copy it.  If the copy is performed without the 
checkout.  The new file will not compile.

I could see an argument for maintaining the read-only status for files copied 
in the Resource perspective.  However, the semantics of copy in the Java 
perspective are very different.  A Java perspective copy implicitly changes a 
file and therefore needs to remove the read-only attribute.  

The behavior in Win NT seems to be dependent on the file system.  When using 
explorer to copy a file in an NTFS partition, the read-only attribute.  
However, when you copy a file in a clearcase view (they have their own file 
system.) The new file does not have the read-only attribute.
Comment 5 Erich Gamma CLA 2002-05-11 15:12:29 EDT

*** This bug has been marked as a duplicate of 4210 ***