2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
9 #include <proto/workbench.h>
10 #include "icon_intern.h"
12 /*****************************************************************************
15 #include <proto/icon.h>
17 AROS_LH1(BOOL
, DeleteDiskObject
,
20 AROS_LHA(UBYTE
*, name
, A0
),
23 struct IconBase
*, IconBase
, 23, Icon
)
26 Deletes an icon description file.
29 name - name of the icon file without the ".info".
45 *****************************************************************************/
53 if (!(infofilename
= (UBYTE
*)AllocVec (strlen(name
) + 6,
54 MEMF_ANY
| MEMF_CLEAR
)
58 /* Construct the icon's name */
59 strcpy (infofilename
, name
);
60 strcat (infofilename
, ".info");
62 lock
= Lock(infofilename
, SHARED_LOCK
);
64 parent
= ParentDir(lock
);
65 UnLock(lock
); // DeleteFile() fails on locked files
67 success
= DeleteFile (infofilename
);
68 if (success
&& WorkbenchBase
) {
69 UpdateWorkbench(FilePart(name
), parent
, UPDATEWB_ObjectRemoved
);
71 ioerr
= IoErr(); // UnLock() resets error
77 FreeVec (infofilename
);
81 } /* DeleteDiskObject */