MonobjcMonobjc Documented Class Library
WriteToFileAtomicallyEncodingError Method (path, useAuxiliaryFile, enc, error)
NamespacesMonobjc.FoundationNSStringWriteToFileAtomicallyEncodingError(NSString, Boolean, NSStringEncoding, NSError%)

Writes the contents of the receiver to a file at a given path using a given encoding.

Original signature is '- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile encoding:(NSStringEncoding)enc error:(NSError **)error'

Available in Mac OS X v10.4 and later.

Declaration Syntax
C#Visual BasicVisual C++
public virtual bool WriteToFileAtomicallyEncodingError(
	NSString path,
	bool useAuxiliaryFile,
	NSStringEncoding enc,
	out NSError error
)
Public Overridable Function WriteToFileAtomicallyEncodingError ( _
	path As NSString, _
	useAuxiliaryFile As Boolean, _
	enc As NSStringEncoding, _
	<OutAttribute> ByRef error As NSError _
) As Boolean
public:
virtual bool WriteToFileAtomicallyEncodingError(
	NSString^ path, 
	bool useAuxiliaryFile, 
	NSStringEncoding enc, 
	[OutAttribute] NSError^% error
)
Parameters
path (NSString)
The file to which to write the receiver. If path contains a tilde (~) character, you must expand it with stringByExpandingTildeInPath before invoking this method.
useAuxiliaryFile (Boolean)
If YES, the receiver is written to an auxiliary file, and then the auxiliary file is renamed to path. If NO, the receiver is written directly to path. The YES option guarantees that path, if it exists at all, won’t be corrupted even if the system should crash during writing.
enc (NSStringEncoding)
The encoding to use for the output.
error (NSError%)
If there is an error, upon return contains an NSError object that describes the problem. If you are not interested in details of errors, you may pass in NULL.
Return Value
YES if the file is written successfully, otherwise NO (if there was a problem writing to the file or with the encoding).
Version Information
  • Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)

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