deleteResource

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
deleteResource(<file>, <resourceType>,{<resourceID> | <resourceName>})
Summary

Removes a resource from the resource fork of a Mac OS file.

Introduced1.0
OSmac
Platformsdesktop
Parameters
NameTypeDescription
file

The name and location of the file containing the resource. If you specify a name but not a location, LiveCode assumes the file is in the defaultFolder.

resourceType

The 4-character type of the resource you want to delete.

resourceID

An integer that specifies the resource ID of the resource you want to delete.

resourceName

The name of the resource you want to delete.

Example
get deleteResource("New Build","ICN#",129)
put deleteResource(line x of theFiles,"XFCN","Colorize") into temp
Values
NameTypeDescription
return

The deleteResource function always returns empty.

The result

If the file does not exist, the result is set to "can't find file". If the file exists but has no resource fork, the result is set to "can't open resource fork". If the file exists but does not contain the specified resource, the result is set to "can't find the resource specified". If the file is already open, the result is set to "Can't open resource forka/".

RelatedKeyword: file
Property: externals
Command: delete
Function: result, setResource
Control Structure: function
Glossary: resource fork, resource, Mac OS, return
Securitydisk
Description

Use the deleteResource function to delete a resource from a file.

The deleteResource function deletes individual resources within the file, but does not delete the resource fork.

Tagsfile system