Name
hw_Lock -- lock a file system object for examination (V5.0)
Synopsis
APTR handle = hw_Lock(STRPTR name, int mode);
Function
This function can be used to lock a file system object for further examination via the hw_ExLock() call. If the file system object is a directory, you may also iterate through its entries using hw_NextDirEntry().

The following bits are currently supported by the mode parameter:

HWLOCKMODE_READ_LEGACY:
Open the file system object for reading. This must be set. Please note that this flag is actually set to 0 for compatibility reasons. This means that hw_Lock() cannot use the bitwise AND-operator to check if it is set. Instead, it will check if the HWLOCKMODE_WRITE flag is set and in case it isn't set, the file system object will be opened in read mode. You should only use this flag if you also need to target Hollywood 5. For Hollywood 6.0 and higher, use HWLOCKMODE_READ instead (see below).

HWLOCKMODE_WRITE:
Open the file system object for writing. Currently unsupported. Do not use this.

HWLOCKMODE_READ:
File system object should be opened for reading. Please note that this flag requires Hollywood 6.0. If you want to open file system objects for reading with earlier Hollywood versions, use HWLOCKMODE_READ_LEGACY. See above for details. (V6.0)

HWLOCKMODE_NOADAPTER:
If this flag is set, hw_Lock() will skip all file and directory adapters and use Hollywood's inbuilt handlers. Use this only if you have a good reason to skip the file and directory adapters. (V6.0)

This function is thread-safe.

Designer compatibility
Supported since Designer 4.0

Inputs
name
file system object to open
mode
locking mode (see above)
Results
handle
handle to refer to this object later or NULL on error

Show TOC