Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro Equivilant of ATTRIB command?
Message
From
09/08/2002 12:03:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00688042
Message ID:
00688051
Views:
19
>Is there anyway to change the attributes of a file in VFP6? Either a built in command/control, or a third party VCX would work fine...
>
>Thanks
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 )
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform