Name: rm29839 Date: 05/26/98
This one is simple. At least two platforms, the BeOS and the MacOS, have file
metadata. This metadata cannot be copied in a platform independent way,
which makes it very difficult to make a backup copy of a file before writing
the new one. (I know I can rename the file, but that is not always appropriate,
if I intend to append, rather than rewrite fresh)
In order to do a file copy on the MacOS, I need different code than for the
Windows and Solaris platforms. It is my expectation that file metadata is
going to get more common, and that a simple, universal method for copying
data would be useful. If such a method were provided, then it would be up
to the platform vendors to implement it in a way that properly dealt with
resource forks, attributes, and metadata, but the individual developer
would not have to.
Finally, this can cover the issue of permissions on Unix platforms. If a
program makes a copy of the file, then the permissions and owner
could be copied as well.
Since it is a simple method, the signature would be something like
copy(File destination, boolean overwrite, boolean copyMetadata) throws IOException
overwrite is not all that needed, since it is not that hard to check for
existence first, and, in my mind, copyMetadata should be the default
behavior all of the time, but some may complain that they do not
always want all permissions, etc. to be copied.
Scott
(Review ID: 29718)
======================================================================
Name: skT88420 Date: 02/03/2000
java version "1.1.6"
While trying to copyfiles, the developer has to use the read/write methods on
files. This results in the destination having the latest timestamp as opposed to
that of the original file.
We need a mechanism that essentially results in a filecopy.
(Review ID: 100727)
======================================================================
This one is simple. At least two platforms, the BeOS and the MacOS, have file
metadata. This metadata cannot be copied in a platform independent way,
which makes it very difficult to make a backup copy of a file before writing
the new one. (I know I can rename the file, but that is not always appropriate,
if I intend to append, rather than rewrite fresh)
In order to do a file copy on the MacOS, I need different code than for the
Windows and Solaris platforms. It is my expectation that file metadata is
going to get more common, and that a simple, universal method for copying
data would be useful. If such a method were provided, then it would be up
to the platform vendors to implement it in a way that properly dealt with
resource forks, attributes, and metadata, but the individual developer
would not have to.
Finally, this can cover the issue of permissions on Unix platforms. If a
program makes a copy of the file, then the permissions and owner
could be copied as well.
Since it is a simple method, the signature would be something like
copy(File destination, boolean overwrite, boolean copyMetadata) throws IOException
overwrite is not all that needed, since it is not that hard to check for
existence first, and, in my mind, copyMetadata should be the default
behavior all of the time, but some may complain that they do not
always want all permissions, etc. to be copied.
Scott
(Review ID: 29718)
======================================================================
Name: skT88420 Date: 02/03/2000
java version "1.1.6"
While trying to copyfiles, the developer has to use the read/write methods on
files. This results in the destination having the latest timestamp as opposed to
that of the original file.
We need a mechanism that essentially results in a filecopy.
(Review ID: 100727)
======================================================================
- duplicates
-
JDK-4313887 New I/O: Improved filesystem interface
- Resolved
- relates to
-
JDK-4084666 Folder class to encapsulate the details of a file on a particular file system
- Closed
-
JDK-4151287 java.io.File: Add copyTo, rmDir
- Closed
-
JDK-4302202 File - add means of accessing resource fork and extended attributes
- Closed
-
JDK-6469152 File.copyTo(File) to simply copy a file to specified directory
- Closed