Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know if file is read-only?
Message
From
30/03/2004 10:14:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
How to know if file is read-only?
Miscellaneous
Thread ID:
00890787
Message ID:
00890787
Views:
40
Hi all,

I use the GetFileAttributes Win32API function to get the file attributes. However, the return value is the sum of all the attributes. I know that Read-Only is equal to 1. Is there a quick way to MOD() out this value? For example:
* myFile.txt attributes: Archive (32) , Read-Only (1)
GetFileAttribute('myFile.txt') && 33
*---------------------------------------------------------------------------
function GetFileAttribute(cFileName)
	if type('cFileName')!='C' or !file(cFileName)
		return -1
	endif
	DECLARE INTEGER GetFileAttributes IN WIN32API STRING @ lpFileName
	return GetFileAttributes(cFileName)
endfunc
ramil
~~ learning to stand still
Next
Reply
Map
View

Click here to load this message in the networking platform