Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set file readonly
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Set file readonly
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01656088
Message ID:
01656088
Views:
56
I want to set a file from read-write to read-only and copy the following code (from Google) to my program, but failed. Anyone can point out what is wrong?

TIA
Ben

*--------------------------------------------
FUNC changeattr
DECLARE INTEGER SetFileAttributes IN kernel32 STRING @,INTEGER @
PRIVATE cFn
cFilename="e:\testingfa\testfile.txt"
#DEFINE FILE_ATTRIBUTE_READONLY 0x1
m=SetFileAttributes(@cFilename,FILE_ATTRIBUTE_READONLY)
RETURN m
Next
Reply
Map
View

Click here to load this message in the networking platform