Error getting tags :
error 404Error getting tags :
error 404 getResources | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
getResources
Basics
Expander triangle
Type
Function
Syntax
getResources(filePath[,resourceType])
Introduced
1.0
Changed
1.1
Environment
Desktop,Web
Platform Support
MacOS,Mac OS X
Security
Disk
Summary
Returns a list of the resources in a Mac OSfile.
Examples

getResources("Project Resources")
getResources(it,"STR#")

Additional Comments
Expander triangle

Use the getResources function to find out whether a resource already exists before using it or copying it.

Parameters:

The filePath is the location and name of the file whose resource fork you want to list. If you specify a name but not a location, Revolution assumes the file is in the defaultFolder.

The resourceType is the 4-character type of the resources you want to list. If you don't specify a resourceType, the getResources function lists all the resources of all resource types.

Value:

The getResources function returns a list of resources, one per line. Each line consists of four items:

* the 4-character resource type

* the resource ID

* the resource name

* the resource size in bytes

* one or more resource flag characters. The possible resource flags are as follows:

S System heap

U Purgeable

L Locked

P Protected

R Preload

C Compressed resource

If a flag is set to true, its character is included in the last item. If the flag is set to false, its character is not included. If none of these flags is set for a resource, the last item of that resource's line is empty.

If the file does not contain any resources, the getResources function returns empty.

Comments:

If the filePath does not exist, the result is set to "can't find file". If the filePath exists, but the file has no resource fork, the result is set to "can't open resource fork".

If the file has a resource fork but no resources, the result is empty.

Changes to Revolution:

The order of items returned by the getResources function was changed in version 1.1. In previous versions, the getResources function returned these items for each resource:

* the resource name

* the resource ID

* the 4-character resource type

* the resource size in bytes

The resource flags item of the return value was introduced in version 1.1. In previous versions, the resource flags were not available.

User Comments
Expander triangle