Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 6.0 - File Attributes
Message
From
17/02/1999 14:37:59
 
 
To
17/02/1999 14:26:59
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00188577
Message ID:
00188585
Views:
18
>Is there a way in VFP to change,add or remove the file attributes.
>I am trying to change the "Read Only" attribute of a file.
>

The following API code should work; there's a downloadable file here on UT that implements this in a bit more palatable form

The Read only attribute is
DECLARE INTEGER SetFileAttributes IN Kernel32 ;
	STRING cFileNameToAlter, ;
	INTEGER nAttributeMask
*  Set the nAttribs value to the appropriate mask, if the bit is set, it's active, not set is inactive
*      Read-only :  nAttrib should be 1,  else 0
*      bit settings are cuumulative
*
*	R = Read-only	1
*	H = Hidden		2
*	S = System		4
*	A = Archive		32 
IF (SetFileAttributes(FULLPATH(tcFileName), nAttribs) = 1)
   *  It worked
ELSE
   * It didn't
ENDIF
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform