Missing created files
Missing created files
- Subject: Missing created files
- From: Michael Becker <email@hidden>
- Date: Fri, 5 Nov 2004 16:15:30 +0100
Hi!
Very weird problem: I am trying to save an image as JPG to disk. Even though Cocoa tells me everything is fine, there is no file! Here is my code:
NSLog(@"Creating file at %@", path);
NSData *imageData = [imageRep representationUsingType:NSJPEGFileType properties:propDict];
BOOL successful = [[ NSFileManager defaultManager] createFileAtPath:path contents:imageData attributes:nil];
if (successful) NSLog(@"Successful");
All the objects are valid (there are no nil's etc.), I checked that. The runtime output is:
2004-11-05 16:08:56.925 PhotoClient3[645] Creating file at /Users/michael/.photoservice/0.jpg
2004-11-05 16:08:57.515 PhotoClient3[645] Successful
And here is the output of the Terminal:
of081:~/.photoservice michael$ ls -la
total 0
drwxr-xr-x 2 michael michael 68 5 Nov 16:13 .
drwxr-xr-x 30 michael michael 1020 5 Nov 16:12 ..
of081:~/.photoservice michael$
What is happening here? Before trying to create the file, I tried NSData's writeToFile:atomically: which did not work either. However, if a file at the given path already EXISTS, there seems to be no problem at all.
What am I missing here?
Regards,
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden