Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know if file is read-only?
Message
De
30/03/2004 10:14:51
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
How to know if file is read-only?
Divers
Thread ID:
00890787
Message ID:
00890787
Vues:
39
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform