TMChangeDirectory Overview Group

The TMChangeDirectory API call sets or reads the current working directory. There is an 'operation' flag that indicates if the call is to set or read the current directory. Here are the values of 'operation':

0 :  current directory is set

1 :  current directory is read

The value in 'cd_buf' is a DirectoryPath structure that either contains the directory to be set or the current directory read depending on the 'operation' flag. 'cd_buf' must be a DirectoryPath structure.


short far pascal TMChangeDirectory(

long session_handle,      // session handle for the desired 1-Wire network
void far *state_buffer,   // state buffer provided for the 1-Wire network session
short operation,          // Reading(1) or setting(0) the current directory
DirectoryPath far *cd_buf // pointer to a structure with the directory information
);

For a description of the above types, see the TMEX Type Descriptions.

Parameters

session_handle

Specifies the session handle returned from the API function TMExtendedStartSession that specifies the desired 1-Wire network port. This parameter is required by most TMEX API functions.

state_buffer

Specifies a pointer to a memory location that TMEX keeps all of the state information for the 1-Wire networks. This parameter is required by most TMEX API functions.

operation

Specifies whether reading or setting the current directory. (1) indicates reading and (0) indicates setting.

cd_buf

Specifies a pointer to a memory location that contains a DirectoryPath structure. This structure filled before calling this API if the operation is setting(0). If the operation is reading(1) then this buffer will contain the current directory from the root after the API call.

Return Value

1 => operation is successful

<0 => TMEX File Operations Error Return Code

Code Example

See Also

TMDirectoryMRFile, TMFirstFile