MonobjcMonobjc Documented Class Library
ReplaceItemAtURLWithItemAtURLBackupItemNameOptionsResultingItemURLError Method (originalItemURL, newItemURL, backupItemName, options, resultingURL, error)
NamespacesMonobjc.FoundationNSFileManagerReplaceItemAtURLWithItemAtURLBackupItemNameOptionsResultingItemURLError(NSURL, NSURL, NSString, NSFileManagerItemReplacementOptions, NSURL%, NSError%)

Replaces the contents specified by the first URL with the contents of the second URL in a manner that insures no data loss occurs.

Original signature is '- (BOOL)replaceItemAtURL:(NSURL *)originalItemURL withItemAtURL:(NSURL *)newItemURL backupItemName:(NSString *)backupItemName options:(NSFileManagerItemReplacementOptions)options resultingItemURL:(NSURL **)resultingURL error:(NSError **)error'

Available in Mac OS X v10.6 and later.

Declaration Syntax
C#Visual BasicVisual C++
public virtual bool ReplaceItemAtURLWithItemAtURLBackupItemNameOptionsResultingItemURLError(
	NSURL originalItemURL,
	NSURL newItemURL,
	NSString backupItemName,
	NSFileManagerItemReplacementOptions options,
	out NSURL resultingURL,
	out NSError error
)
Public Overridable Function ReplaceItemAtURLWithItemAtURLBackupItemNameOptionsResultingItemURLError ( _
	originalItemURL As NSURL, _
	newItemURL As NSURL, _
	backupItemName As NSString, _
	options As NSFileManagerItemReplacementOptions, _
	<OutAttribute> ByRef resultingURL As NSURL, _
	<OutAttribute> ByRef error As NSError _
) As Boolean
public:
virtual bool ReplaceItemAtURLWithItemAtURLBackupItemNameOptionsResultingItemURLError(
	NSURL^ originalItemURL, 
	NSURL^ newItemURL, 
	NSString^ backupItemName, 
	NSFileManagerItemReplacementOptions options, 
	[OutAttribute] NSURL^% resultingURL, 
	[OutAttribute] NSError^% error
)
Parameters
originalItemURL (NSURL)
The item being replaced.
newItemURL (NSURL)
The item which will replace the originalItemURL. This item should be placed in a temporary directory as provided by the OS, or in a uniquely named directory placed in the same directory as the original item if the temporary directory is not available.
backupItemName (NSString)
Optional. If provided, this name will be used to create a backup of the original item.
options (NSFileManagerItemReplacementOptions)
Specifies the options used in the replacement. Passing 0 provides the default behavior which uses only the metadata from the new item. The values in “NSFileManagerItemReplacementOptions” are also valid and can be combined using the C-bitwise OR operator. Typically 0 is passed.
resultingURL (NSURL%)
This URL will be set to the URL which points at the new item. resultingURL may be the same as originalItemURL if the replacement could be made without having to create a new filesystem object. resultingURL may be different than originalItemURL if the replacement could not be made without having to create a new object (e.g. going from an rtf document to an rtfd requires the creation of a new item - in this case, resultingURL would locate the newly-created rtfd).
error (NSError%)
If an error occurs, upon return contains an NSError object that describes the problem. Pass NULL if you do not want error information.
Return Value
Returns YES if the replacement was successful, otherwise NO.
Version Information
  • Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later)

Assembly: Monobjc.Foundation (Module: Monobjc.Foundation)