tfFSOpenDir
Table of Contents >> Application Reference >> File System Interface
| #include <trsocket.h> |
| void * tfFSOpenDir | ( |
| void * userDataPtr, | |
| char * pathNamePtr, | |
| int flag | |
| ); |
Function Description
Given the unique user data pointer as returned by tfFSUserLogin(), a pointer to a path name, and a flag, this function opens the directory corresponding to the path for reading either a long directory ('flag' is TM_DIR_LONG) or short directory ('flag' is TM_DIR_SHORT). Subsequent calls to tfFSGetNextDirEntry() will fetch each entry in the directory matching the pattern as pointed to by 'pathNamePtr'. The tfFSOpenDir() implementer should allocate a directory data structure to keep track of the path name matching pattern, the reading position in the directory, and the directory read flag (TM_DIR_LONG or TM_DIR_SHORT). Note that if 'pathNamePtr' points to a directory name, then the matching pattern is "*.*". If 'pathNamePtr' points to "*.*", then the user working directory should be open, and the matching pattern is "*.*".
Parameters
- userDataPtr
- Pointer to user data structure as returned by tfFSUserLogin().
- pathNamePtr
- Pointer to a null terminated string containing pathname.
- flag
- Either TM_DIR_LONG or TM_DIR_SHORT.
Returns
- (void *)0
- Failure.
- (Other)
- Pointer to newly allocated directory data structure.
Table of Contents >> Application Reference >> File System Interface