User Guide

368 Chapter 21: C-Level Extensibility
JSBool MM_GetConfigFileAttributes()
Availability
Dreamweaver MX.
Description
This function finds the file and returns the attributes of the file. You can set any of the arguments
except
fileURL to null if you do not need the value.
Arguments
char *fileURL, unsigned long *attrs, unsigned long *filesize,
unsigned long *modtime, unsigned long *createtime
The char *fileURL argument is a pointer to a string that names the file for which you want
the attributes. You must provide this argument as a file:// URL. If
fileURL specifies a path in
the Dreamweaver Configuration folder, the
MM_GetConfigFileAttributes() function
resolves the path before opening the file.
The unsigned long *attrs argument is the address of an integer that contains the returned
attribute bits (see JSBool MM_SetConfigFileAttributes() for available attributes).
The unsigned long *filesize argument is the address of an integer in which the function
returns the file size in bytes.
The unsigned long *modtime argument is the address of an integer in which the function
returns the time that the file was last modified. The time is given as the operating-system time
value. For more information about the operating-system time value, see
DWfile.getModificationDate() in the Dreamweaver API Reference.
The unsigned long *createtime argument is the address of an integer in which the
function returns the time that the file was created. The time is given as the operating-system
time value. For more information on the operating system time value, see
DWfile.getCreationDate() in the Dreamweaver API Reference.
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure. Returns JS_FALSE if the
file does not exist or an error occurs while getting the attributes.
Example
char dwConfig = "file:///c|/
Program Files/Macromedia/Dreamweaver/
Configuration/Extensions.txt";
unsigned long attrs;
unsigned long filesize;
unsigned long modtime;
unsigned long createtime;
MM_GetConfigAttributes(dwConfig, &attrs, &filesize, &modtime, &createtime);