DemoGL::Reference::Functions::DEMOGL_FileGetLength

DEMOGL_FileGetLength

DEMOGL_FileGetLength reports the length in bytes of the file with the name pointed by pszFilename.

long
DEMOGL_FileFree(
	const char *pszFilename
);
	
Parameters.
pszFilename
Pointer to a zero-terminated string which represents the filename, inclusive subpaths, of the file you want the length of.

Return values.
The length of the file in bytes.
If pszFilename is not found or an error occured, it returns 0.

Remarks.
Because DemoGL does all the File I/O for you and returns a buffer with the data to you, you don't know how large these files are and thus how large the buffer is. Use this function in combination with DEMOGL_FileLoad. Keep in mind that the filename pointed by pszFilename should contain C/C++ backslash escaping plus should contain the paths needed, thus starting from the root directory DemoGL expects the data, which can be a directory on disk or a datafile with subdirs.

Example.
long	lFileLength;

// find the size of a system texture.
lFileLength = DEMOGL_FileGetLength("systex\\cnslbg.jpg");
	

Requirements.
DemoGL v1.3 (build 0112 or higher)

See also.
DEMOGL_FileLoad

Last changed on 20-jan-2001

©1999-2001 Solutions Design