Jump to content

File input/output: Difference between revisions

m (→‎{{header|jq}}: any number of JSON entities)
Line 1,653:
 
=={{header|Objective-C}}==
{{works with|Cocoa}}
 
For copying files, using <code>NSFileWrapper</code> is preferred:
{{works with|GNUstep}}
 
<lang objc>[[NSFileManager defaultManager] copyItemAtPath:@"input.txt" toPath:@"output.txt" error:NULL];</lang>
Read the contents of input.txt and place it in output.txt, creating a file if needed:
 
If you want to do it manually:
 
<lang objc>NSData *data = [NSData dataWithContentsOfFile:@"input.txt"];
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.