Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

swimlikehell

macrumors member
Original poster
Aug 31, 2006
46
0
Hello,

I am trying to create some code that will delete a non-empty directory so that a user can replace an application in a specific folder on their computer. I have tried using FSDeleteObject but that only would on empty directories. Any help would be much appreciated, thanks.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
I tried looking for a Carbon solution but couldn't find anything. I'm sure there is some code snippet out there though. You could also just try using standard POSIX functions.

But in Cocoa it's as simple as:

Code:
[[NSFileManager defaultManager] removeFileAtPath:somePath handler:nil];

:)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.