• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
File not closing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

File not closing


  • Subject: File not closing
  • From: Trygve Inda <email@hidden>
  • Date: Thu, 08 May 2003 20:50:23 +0200

This is possibly a Cocoa/Carbon hybrid question but...

I have a Carbon app that creates a series of image files in my App Support
folder. These images are set to the desktop with NotificationCenter. Once
the desktop is replaced, the old file (created by my app) is deleted.

I am running into a conflict with another developer's app (Cocoa) that is
reading the desktop picture whenever it changes and loading it for its own
use...

So my app sets the desktop, and then a Cocoa app reads in the new desktop
image, but somehow prevents me from deleting it after I have set a new image
about a minute later.

NSImage *deskImage = [[[NSImage alloc] initWithContentsOfFile:imagePath]
autorelease];

It seems this call (made by another app) prevents my app from being able to
delete the files it is generating.

As I am not experienced with Cocoa, what might be causing this? Is there a
better way to do this such that the file is not left open? What does
"autorelease" really do?

(In My Carbon app, FSDeleteObject returns -47 (file busy)).

Thanks,

Trygve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: File not closing
      • From: Chris Ridd <email@hidden>
References: 
 >Re: Song dragged from iTunes (From: Calvin Chen <email@hidden>)

  • Prev by Date: Re: Memory Management Mismanaged
  • Next by Date: Notification when a modal event loop is activated?
  • Previous by thread: Re: Song dragged from iTunes
  • Next by thread: Re: File not closing
  • Index(es):
    • Date
    • Thread