How to Set File Attributes: Use C to Create FLL & Then Call ItID: Q126454 The information in this article applies to:
SUMMARYYou can change the attributes of a file in FoxPro for Windows without performing a RUN ATTRIB <attributes> <filename>. This article contains:
MORE INFORMATION
C Code to Create an FLL that Can Be Called from FoxPro
{
unsigned FAttr, retst;
if(!_SetHandSize(parm->p[0].val.ev_handle, parm->p[0].val.ev_length + 1)) {
}
_HLock(FN.ev_handle);
_HLock(FA.ev_handle);
FName = (char FAR *) _HandToPtr(parm->p[0].val.ev_handle); FName[parm->p[0].val.ev_length] = '\0'; FAttr = (unsigned) FA.ev_long; // set FAttr value and convert second _HUnLock(FN.ev_handle);
_HUnLock(FA.ev_handle);
_RetInt(retst, 10); // return success or failure (0 = success) otherwise DOS }
FoxInfo myFoxInfo[] = { };
FoxTable _FoxTable = { };
FoxPro Code Sample Showing How to Use the FLLThe following FoxPro code shows by example how to use the FLL to change the attributes of the file CUSTOMER.DBF to read only, and then reset all of the attributes. Also included is a table showing what each of the numbers means to the function _dos_setfileattr.
Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60 2.60a
KBCategory: kbtool kbcode kbprg
KBSubcategory: FxtoolLck
|
|
Last Reviewed: June 27, 1995 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |