Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programatically altering file properties
Message
From
03/12/2001 07:27:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
03/12/2001 07:12:38
Philip Jones
Cornwall County Council
Truro, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00588637
Message ID:
00588640
Views:
15
>I'd like to be able to alter the properties of a free table I'm creating programatically. I want to hide it and make it read only. I also want to be able to change the read only attribute when I want to append records to it and them change it back again after appending. Can anyone suggest a way of simple doing this please.
lparameters tcFileName, tlReadOnly, tlHidden, tlSystem

#define BIT_READONLY  0
#define BIT_HIDDEN 1
#define BIT_SYSTEM 2

declare integer SetFileAttributes in Win32API ;
	string @ lpFileName,  integer dwFileAttributes
declare integer GetFileAttributes in Win32API ;
  string @ lpFileName
if tlReadOnly
 SetFileAttributes(@tcFilename, bitset(GetFileAttributes(@tcFilename),BIT_READONLY))
else
 SetFileAttributes(@tcFilename, bitclear(GetFileAttributes(@tcFilename),BIT_READONLY))
endif
if tlHidden
 SetFileAttributes(@tcFilename, bitset(GetFileAttributes(@tcFilename),BIT_HIDDEN))
else
 SetFileAttributes(@tcFilename, bitclear(GetFileAttributes(@tcFilename),BIT_HIDDEN))
endif
if tlSystem
 SetFileAttributes(@tcFilename, bitset(GetFileAttributes(@tcFilename),BIT_SYSTEM))
else
 SetFileAttributes(@tcFilename, bitclear(GetFileAttributes(@tcFilename),BIT_SYSTEM))
endif
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