mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
When copying objects we should not be attempting to set the creation/modification date of the copy to that of the original.
This commit is contained in:
parent
0c302348b0
commit
684e952b04
1 changed files with 8 additions and 4 deletions
|
@ -564,7 +564,6 @@ static NSStringEncoding defaultEncoding;
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
date = [attributes fileCreationDate];
|
||||
if (date != nil && NO == [date isEqual: [old fileCreationDate]])
|
||||
{
|
||||
|
@ -1281,9 +1280,10 @@ static NSStringEncoding defaultEncoding;
|
|||
}
|
||||
fileType = [attrs fileType];
|
||||
|
||||
/*
|
||||
* Don't attempt to retain ownership of copy ... we want the copy
|
||||
/* Don't attempt to retain ownership of copy ... we want the copy
|
||||
* to be owned by the current user.
|
||||
* Also, the new copy should not have the creation/modification
|
||||
* date of the original.
|
||||
*/
|
||||
attrs = AUTORELEASE([attrs mutableCopy]);
|
||||
[(NSMutableDictionary*)attrs removeObjectForKey: NSFileOwnerAccountID];
|
||||
|
@ -1292,11 +1292,15 @@ static NSStringEncoding defaultEncoding;
|
|||
[(NSMutableDictionary*)attrs setObject: NSUserName()
|
||||
forKey: NSFileOwnerAccountName];
|
||||
|
||||
[(NSMutableDictionary*)attrs removeObjectForKey: NSFileCreationDate];
|
||||
[(NSMutableDictionary*)attrs removeObjectForKey: NSFileModificationDate];
|
||||
|
||||
if ([fileType isEqualToString: NSFileTypeDirectory] == YES)
|
||||
{
|
||||
|
||||
/* If destination directory is a descendant of source directory copying
|
||||
isn't possible. */
|
||||
* isn't possible.
|
||||
*/
|
||||
if ([[destination stringByAppendingString: @"/"]
|
||||
hasPrefix: [source stringByAppendingString: @"/"]])
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue