![]() |
![]() |
![]() |
![]() |
"Directory Info"Availability: LightWave 5.5 - 6.0, Inspire 1.0 The function returned by the directory info global gives plug-ins read-only access to LightWave's internal directory list. This tells you where LightWave would look first for a given item. It can be used to set the initial path for a file request. Global Call LWDirInfoFunc *dirinfo; dirinfo = global( "Directory Info", GFUSE_TRANSIENT ); The global function returns a pointer to an LWDirInfoFunc. typedef const char * LWDirInfoFunc (const char *name); The name argument identifies which directory path should be returned by the directory info function. It can be any of the strings in the list below. The paths returned by Layout are relative to the content directory. You can fully qualify these paths by also asking for the content directory path, although in most cases this will correspond to the operating system's current working directory, so that the relative path will point to the same location without being expanded to a full path.
Example This code fragment initializes a path string with the default directory for images. #include <lwserver.h> #include <lwhost.h> #define MAXFILESZ 260 char *imgdir, path[ MAXFILESZ ] = ""; LWDirInfoFunc *dirinfo; dirinfo = global( "Directory Info", GFUSE_TRANSIENT ); if ( dirinfo ) { imgdir = dirinfo( "Images" ); if ( imgdir ) if ( strlen( imgdir ) < MAXFILESZ ) strcpy( path, imgdir ); } ... |