Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read Only
Message
De
15/08/2002 03:54:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/08/2002 18:55:21
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00689759
Message ID:
00689875
Vues:
18
>Hi!
>
>Try this to change:
>
>declare integer SetFileAttributes in Win32API ;
>	string @ lpFileName,  integer dwFileAttributes
>declare integer GetFileAttributes in Win32API ;
>  string @ lpFileName
>
>function ChangeAttrib
>Lparameters tcFileName, tlReadOnly, tlHidden, tlSystem
>#Define FILE_ATTRIBUTE_READONLY             0x00000001
>#Define FILE_ATTRIBUTE_HIDDEN               0x00000002
>#Define FILE_ATTRIBUTE_SYSTEM               0x00000004
>Local lnNewAttr
>lnNewAttr = iif(tlReadOnly,FILE_ATTRIBUTE_READONLY,0)+;
>	iif(tlHidden,FILE_ATTRIBUTE_HIDDEN,0)+;
>	iif(tlSystem,FILE_ATTRIBUTE_SYSTEM,0)
>Return ( SetFileAttributes(@tcFileName, ;
>	bitor(bitand(GetFileAttributes(@tcFileName),0xFFFFFFF8),lnNewAttr)) = 1 )
>
>I see this sample in a thread here in the UT but I don´t remember the number.
>Bye!
>
>P.S.: Sorry my bad english.

Mahmood,
You could use this code shorthened just for RO flag :
* DLL Declarations
declare integer SetFileAttributes in Win32API ;
	string @ lpFileName,  integer dwFileAttributes
declare integer GetFileAttributes in Win32API ;
  string @ lpFileName

* Remove RO flag
SetFileAttributes(@lcFilename, bitclear(GetFileAttributes(@lcFilename),0))
* Set RO flag
SetFileAttributes(@lcFilename, bitset(GetFileAttributes(@lcFilename),0))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform