Home > Archive > FoxPro Help and Support > July 2005 > set a report file to read only









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author set a report file to read only
ghj

2005-07-17, 8:24 pm

Is there a command in VFP9.0 to toggle or set/clear a file's read-only
attribute.

Thanks


Fred Taylor

2005-07-17, 8:24 pm

#DEFINE FILE_ATTRIBUTE_READO
NLY 0x00000001
#DEFINE FILE_ATTRIBUTE_HIDDE
N 0x00000002
#DEFINE FILE_ATTRIBUTE_SYSTE
M 0x00000004
#DEFINE FILE_ATTRIBUTE_DIREC
TORY 0x00000010
#DEFINE FILE_ATTRIBUTE_ARCHI
VE 0x00000020
#DEFINE FILE_ATTRIBUTE_NORMA
L 0x00000080
#DEFINE FILE_ATTRIBUTE_TEMPO
RARY 0x00000100

DECLARE INTEGER SetFileAttributes IN Win32API STRING @cFile, INTEGER
nAttribs
lcFile = "x:\path\yourfile.ext" + CHR(0) && must end in a 0 byte!
*
* lnSet - other bit options not used are RESET!
*
lnSet = FILE_ATTRIBUTE_NORMA
L && Replaced by other attributes
lnSet = BITOR(lnSet,FILE_ATT
RIBUTE_READONLY)
*
* Returns:
* 0 - error
* 1 - success
*
lxRetVal = SetFileAttributes(@l
cFile,lnSet)


--
Fred
Microsoft Visual FoxPro MVP


"ghj" <ghj@ghj.com> wrote in message news:yiBCe.3875$ij3.154@trndny06...
> Is there a command in VFP9.0 to toggle or set/clear a file's read-only
> attribute.
>
> Thanks
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com